<template>
  <div class="main-box">
    <div class="table-box">
      <div
        style="display: flex; align-items: center; padding: 10px; margin-bottom: 12px; background: #ffffff; border-radius: 8px"
      >
        <span style="margin-right: 20px">选择报告类型：</span>
        <el-select
          v-model="ReportType"
          clearable
          placehoder="请选择"
          size="large"
          style="width: 180px"
          @change="selectReportType"
        >
          <el-option label="日报" value="0" />
          <el-option label="周报" value="1" />
          <el-option label="月报" value="2" />
        </el-select>
      </div>
      <ProTable
        ref="proTable"
        :columns="columns"
        :request-api="getDailyWorkList"
        :data-callback="dataCallback"
        :init-param="initParam"
      >
        <template #tableHeader="">
          <div style="display: flex">
            <el-button type="primary" plain @click="addReleaseBtn">新增</el-button>
            <!-- <el-button type="primary" plain @click="getplan">获取</el-button> -->

            <!--   <el-button type="danger" :disabled="!scope.isSelected" plain @click="delSelectItem(scope.selectedList)">
              删除
            </el-button> -->
            <el-button type="primary" plain @click="dialogTableVisible = true">导出文档</el-button>
          </div>
        </template>
        <!-- 表格操作 -->
        <template #operation="scope">
          <el-button type="primary" link :icon="View" @click="seeDetails(scope.row)">查看</el-button>
          <el-button type="primary" link :icon="EditPen" @click="editEvent(scope.row)">编辑</el-button>
          <el-button type="primary" link :icon="Delete" @click="deleteItem(scope.row)">删除</el-button>
        </template>
      </ProTable>
      <el-drawer v-model="dialogVisible" :title="titleText" size="1000" @close="closeDrawer">
        <div ref="drawerRef">
          <div>
            <el-radio-group v-model="radio" v-if="titleText === '新增报告'" @change="changeRadio">
              <el-radio :value="0">日报</el-radio>
              <el-radio :value="1">周报</el-radio>
              <el-radio :value="2">月报</el-radio>
            </el-radio-group>

            <!-- <el-button type="primary" plain @click="getplan2">获取2</el-button> -->
            <!-- <span style="margin-left: 40px" v-if="radio==0">日报时间：
              <el-date-picker
              v-model="pictureDataForm.ribaoDate"
              type="date"
              placeholder="选择日期"
              value-format="YYYY-MM-DD HH:mm:ss"
            />
            </span>
            <span style="margin-left: 40px" v-if="radio==1">周报开始时间 :
               <el-date-picker
              v-model="pictureDataForm.zhoubaoStartDate"
              type="date"
              placeholder="选择日期"
              value-format="YYYY-MM-DD HH:mm:ss"
            />
            </span>
             <span style="margin-left: 40px" v-if="radio==1">周报结束时间 :
               <el-date-picker
              v-model="pictureDataForm.zhoubaoEndDate"
              type="date"
              placeholder="选择日期"
              value-format="YYYY-MM-DD HH:mm:ss"
            />
            </span>
             <span style="margin-left: 40px" v-if="radio==2">月报时间 :
               <el-date-picker
              v-model="pictureDataForm.yuebaoDate"
              type="month"
              placeholder="选择日期"
              value-format="YYYY-MM-DD HH:mm:ss"
            />
            </span> -->
          </div>
          <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
            <!-- <el-tab-pane label="桌面" name="deskTop"  v-if="gangweiSelect.includes('桌面')">
              <h3>桌面运维事件</h3>
              <div v-if="showoptionChart==true"  style="height: 300px; width: 100%">
                <ECharts :option="option"  />
              </div>
              <span v-if="showoptionChart==true" >注：从上图不难发现，桌面运维事件中TOP1为{{optionTopData.t1name}}占{{optionTopData.t1num}}件，TOP2为{{optionTopData.t2name}}占{{optionTopData.t2num}}件，TOP3为{{optionTopData.t3name}}占{{optionTopData.t3num}}件。</span>
              <WangEditor v-model:value="dtEvent" height="260px" width="300px" style="min-height: 400px" />
              <h3>桌面运维专项工作</h3>
              <div v-if="showDeskWorkChart==true" style="height: 300px; width: 100%">
                <ECharts :option="deskWorkOption" />
              </div>
              <span v-if="showDeskWorkChart==true" >注：从上图不难发现，桌面运维专项工作中TOP1为{{deskWorkTopData.t1name}}占{{deskWorkTopData.t1num}}件，TOP2为{{deskWorkTopData.t2name}}占{{deskWorkTopData.t2num}}件，TOP3为{{deskWorkTopData.t3name}}占{{deskWorkTopData.t3num}}件。</span>
              <WangEditor v-model:value="dtWork" height="400px" width="300px" style="min-height: 400px" />
              <h3>桌面运维存在问题</h3>
              <div v-if="showDeskProblemChart==true" style="height: 300px; width: 100%">
                <ECharts :option="deskProblemOption" />
              </div>
              <span v-if="showDeskProblemChart==true" >注：从上图不难发现，桌面运维存在问题中TOP1为{{deskProblemTopData.t1name}}占{{deskProblemTopData.t1num}}件，TOP2为{{deskProblemTopData.t2name}}占{{deskProblemTopData.t2num}}件，TOP3为{{deskProblemTopData.t3name}}占{{deskProblemTopData.t3num}}件。</span>
              <WangEditor v-model:value="dtProblem" height="400px" width="300px" style="min-height: 400px" />
              <h3>桌面运维重点事件回顾及解决方案</h3>
              <div v-if="showDeskSolutionChart==true" style="height: 300px; width: 100%">
                <ECharts :option="deskSolutionOption" />
              </div>
              <span v-if="showDeskSolutionChart==true" >注：从上图不难发现，桌面运维重点事件回顾及解决方案中TOP1为{{deskSolutionTopData.t1name}}占{{deskSolutionTopData.t1num}}件，TOP2为{{deskSolutionTopData.t2name}}占{{deskSolutionTopData.t2num}}件，TOP3为{{deskSolutionTopData.t3name}}占{{deskSolutionTopData.t3num}}件。</span>
              <WangEditor v-model:value="dtSolution" height="400px" width="300px" style="min-height: 400px" />
              <h3>桌面运维重点事件下{{ typeText }}计划</h3>
              <div v-if="showDeskPlanChart==true" style="height: 300px; width: 100%">
                <ECharts :option="deskPlanOption" />
              </div>
              <span v-if="showDeskPlanChart==true" >注：从上图不难发现，桌面运维重点事件下{{ typeText }}计划中TOP1为{{deskPlanTopData.t1name}}占{{deskPlanTopData.t1num}}件，TOP2为{{deskPlanTopData.t2name}}占{{deskPlanTopData.t2num}}件，TOP3为{{deskPlanTopData.t3name}}占{{deskPlanTopData.t3num}}件。</span>
              <WangEditor v-model:value="dtPlan" height="400px" width="300px" style="min-height: 400px" />
              <el-button type="primary" :icon="View" @click="subDailyWorkForm(0)" style="margin-top: 20px">保存</el-button>
            </el-tab-pane>
            <el-tab-pane label="基础" name="base"  v-if="gangweiSelect.includes('基础')">
              <h3>基础运维事件</h3>
              <div v-if="showBaseEventChart==true" style="height: 300px; width: 100%">
                <ECharts :option="baseEventOption" />
              </div>
              <span v-if="showBaseEventChart==true" >注：从上图不难发现，基础运维事件中TOP1为{{baseTopData.t1name}}占{{baseTopData.t1num}}件，TOP2为{{baseTopData.t2name}}占{{baseTopData.t2num}}件，TOP3为{{baseTopData.t3name}}占{{baseTopData.t3num}}件。</span>
              <WangEditor v-model:value="bsEvent" height="400px" width="300px" style="min-height: 300px" />
              <h3>基础运维专项工作</h3>
              <div v-if="showBaseWorkChart==true" style="height: 300px; width: 100%">
                <ECharts :option="baseWorkOption" />
              </div>
              <span v-if="showBaseWorkChart==true" >注：从上图不难发现，基础运维专项工作中TOP1为{{baseWorkTopData.t1name}}占{{baseWorkTopData.t1num}}件，TOP2为{{baseWorkTopData.t2name}}占{{baseWorkTopData.t2num}}件，TOP3为{{baseWorkTopData.t3name}}占{{baseWorkTopData.t3num}}件。</span>
              <WangEditor v-model:value="bsWork" height="400px" width="300px" style="min-height: 300px" />
              <h3>基础运维存在问题</h3>
              <div v-if="showBaseProblemChart==true" style="height: 300px; width: 100%">
                <ECharts :option="baseProblemOption" />
              </div>
              <span v-if="showBaseProblemChart==true" >注：从上图不难发现，基础运维存在问题中TOP1为{{baseProblemTopData.t1name}}占{{baseProblemTopData.t1num}}件，TOP2为{{baseProblemTopData.t2name}}占{{baseProblemTopData.t2num}}件，TOP3为{{baseProblemTopData.t3name}}占{{baseProblemTopData.t3num}}件。</span>
              <WangEditor v-model:value="bsProblem" height="400px" width="300px" style="min-height: 300px" />
              <h3>基础运维重点事件回顾及解决方案</h3>
              <div v-if="showBaseSolutionChart==true" style="height: 300px; width: 100%">
                <ECharts :option="baseSolutionOption" />
              </div>
              <span v-if="showBaseSolutionChart==true" >注：从上图不难发现，基础运维重点事件回顾及解决方案中TOP1为{{baseSolutionTopData.t1name}}占{{baseSolutionTopData.t1num}}件，TOP2为{{baseSolutionTopData.t2name}}占{{baseSolutionTopData.t2num}}件，TOP3为{{baseSolutionTopData.t3name}}占{{baseSolutionTopData.t3num}}件。</span>
              <WangEditor v-model:value="bsSolution" height="400px" width="300px" style="min-height: 300px" />
              <h3>基础运维重点事件下{{ typeText }}计划</h3>
              <div v-if="showBasePlanChart==true" style="height: 300px; width: 100%">
                <ECharts :option="basePlanOption" />
              </div>
              <span v-if="showBasePlanChart==true" >注：从上图不难发现，基础运维重点事件下{{ typeText }}计划中TOP1为{{basePlanTopData.t1name}}占{{basePlanTopData.t1num}}件，TOP2为{{basePlanTopData.t2name}}占{{basePlanTopData.t2num}}件，TOP3为{{basePlanTopData.t3name}}占{{basePlanTopData.t3num}}件。</span>
              <WangEditor v-model:value="bsPlan" height="400px" width="300px" style="min-height: 300px" />
              <el-button type="primary" :icon="View" @click="subDailyWorkForm(1)" style="margin-top: 20px">保存</el-button>
            </el-tab-pane>
            <el-tab-pane label="网络" name="network" v-if="gangweiSelect.includes('网络')">
              <h3>网络运维事件</h3>
              <div v-if="showNetworkEventChart==true" style="height: 300px; width: 100%">
                <ECharts :option="networkEventOption" />
              </div>
              <span v-if="showNetworkEventChart==true" >注：从上图不难发现，网络运维事件中TOP1为{{networkTopData.t1name}}占{{networkTopData.t1num}}件，TOP2为{{networkTopData.t2name}}占{{networkTopData.t2num}}件，TOP3为{{networkTopData.t3name}}占{{networkTopData.t3num}}件。</span>
              <WangEditor v-model:value="ntEvent" height="400px" width="300px" style="min-height: 300px" />
              <h3>网络运维专项工作</h3>
              <div v-if="showNetworkWorkChart==true" style="height: 300px; width: 100%">
                <ECharts :option="networkWorkOption" />
              </div>
              <span v-if="showNetworkWorkChart==true" >注：从上图不难发现，网络运维专项工作中TOP1为{{networkWorkTopData.t1name}}占{{networkWorkTopData.t1num}}件，TOP2为{{networkWorkTopData.t2name}}占{{networkWorkTopData.t2num}}件，TOP3为{{networkWorkTopData.t3name}}占{{networkWorkTopData.t3num}}件。</span>
              <WangEditor v-model:value="ntWork" height="400px" width="300px" style="min-height: 300px" />
              <h3>网络运维存在问题</h3>
              <div v-if="showNetworkProblemChart==true" style="height: 300px; width: 100%">
                <ECharts :option="networkProblemOption" />
              </div>
              <span v-if="showNetworkProblemChart==true" >注：从上图不难发现，网络运维存在问题中TOP1为{{networkProblemTopData.t1name}}占{{networkProblemTopData.t1num}}件，TOP2为{{networkProblemTopData.t2name}}占{{networkProblemTopData.t2num}}件，TOP3为{{networkProblemTopData.t3name}}占{{networkProblemTopData.t3num}}件。</span>
              <WangEditor v-model:value="ntProblem" height="400px" width="300px" style="min-height: 300px" />
              <h3>网络运维重点事件回顾及解决方案</h3>
              <div v-if="showNetworkSolutionChart==true" style="height: 300px; width: 100%">
                <ECharts :option="networkSolutionOption" />
              </div>
              <span v-if="showNetworkSolutionChart==true" >注：从上图不难发现，网络运维重点事件回顾及解决方案中TOP1为{{networkSolutionTopData.t1name}}占{{networkSolutionTopData.t1num}}件，TOP2为{{networkSolutionTopData.t2name}}占{{networkSolutionTopData.t2num}}件，TOP3为{{networkSolutionTopData.t3name}}占{{networkSolutionTopData.t3num}}件。</span>
              <WangEditor v-model:value="ntSolution" height="400px" width="300px" style="min-height: 300px" />
              <h3>网络运维重点事件下{{ typeText }}计划</h3>
              <div v-if="showNetworkPlanChart==true" style="height: 300px; width: 100%">
                <ECharts :option="networkPlanOption" />
              </div>
              <span v-if="showNetworkPlanChart==true" >注：从上图不难发现，网络运维重点事件下{{ typeText }}计划中TOP1为{{networkPlanTopData.t1name}}占{{networkPlanTopData.t1num}}件，TOP2为{{networkPlanTopData.t2name}}占{{networkPlanTopData.t2num}}件，TOP3为{{networkPlanTopData.t3name}}占{{networkPlanTopData.t3num}}件。</span>
              <WangEditor v-model:value="ntPlan" height="400px" width="300px" style="min-height: 300px" />
              <el-button type="primary" :icon="View" @click="subDailyWorkForm(2)" style="margin-top: 20px">保存</el-button>
            </el-tab-pane>
            <el-tab-pane label="应用" name="app" v-if="gangweiSelect.includes('应用')">
              <h3>应用运维事件</h3>
              <div v-if="showAppEventChart==true" style="height: 300px; width: 100%">
                <ECharts :option="appEventOption" />
              </div>
              <span v-if="showAppEventChart==true" >注：从上图不难发现，应用运维事件中TOP1为{{appTopData.t1name}}占{{appTopData.t1num}}件，TOP2为{{appTopData.t2name}}占{{appTopData.t2num}}件，TOP3为{{appTopData.t3name}}占{{appTopData.t3num}}件。</span>
              <WangEditor v-model:value="appEvent" height="400px" width="300px" style="min-height: 300px" />
              <h3>应用运维专项工作</h3>
              <div v-if="showAppWorkChart==true" style="height: 300px; width: 100%">
                <ECharts :option="appWorkOption" />
              </div>
              <span v-if="showAppWorkChart==true" >注：从上图不难发现，应用运维专项工作中TOP1为{{appWorkTopData.t1name}}占{{appWorkTopData.t1num}}件，TOP2为{{appWorkTopData.t2name}}占{{appWorkTopData.t2num}}件，TOP3为{{appWorkTopData.t3name}}占{{appWorkTopData.t3num}}件。</span>
              <WangEditor v-model:value="appWork" height="400px" width="300px" style="min-height: 300px" />
              <h3>应用运维存在问题</h3>
              <div v-if="showAppProblemChart==true" style="height: 300px; width: 100%">
                <ECharts :option="appProblemOption" />
              </div>
              <span v-if="showAppProblemChart==true" >注：从上图不难发现，应用运维存在问题中TOP1为{{appProblemTopData.t1name}}占{{appProblemTopData.t1num}}件，TOP2为{{appProblemTopData.t2name}}占{{appProblemTopData.t2num}}件，TOP3为{{appProblemTopData.t3name}}占{{appProblemTopData.t3num}}件。</span>
              <WangEditor v-model:value="appProblem" height="400px" width="300px" style="min-height: 300px" />
              <h3>应用运维重点事件回顾及解决方案</h3>
              <div v-if="showAppSolutionChart==true" style="height: 300px; width: 100%">
                <ECharts :option="appSolutionOption" />
              </div>
              <span v-if="showAppSolutionChart==true" >注：从上图不难发现，应用运维重点事件回顾及解决方案中TOP1为{{appSolutionTopData.t1name}}占{{appSolutionTopData.t1num}}件，TOP2为{{appSolutionTopData.t2name}}占{{appSolutionTopData.t2num}}件，TOP3为{{appSolutionTopData.t3name}}占{{appSolutionTopData.t3num}}件。</span>
              <WangEditor v-model:value="appSolution" height="400px" width="300px" style="min-height: 300px" />
              <h3>应用运维重点事件下{{ typeText }}计划</h3>
              <div v-if="showAppPlanChart==true" style="height: 300px; width: 100%">
                <ECharts :option="appPlanOption" />
              </div>
              <span v-if="showAppPlanChart==true" >注：从上图不难发现，应用运维重点事件下{{ typeText }}计划中TOP1为{{appPlanTopData.t1name}}占{{appPlanTopData.t1num}}件，TOP2为{{appPlanTopData.t2name}}占{{appPlanTopData.t2num}}件，TOP3为{{appPlanTopData.t3name}}占{{appPlanTopData.t3num}}件。</span>
              <WangEditor v-model:value="appPlan" height="400px" width="300px" style="min-height: 300px" />
              <el-button type="primary" :icon="View" @click="subDailyWorkForm(3)" style="margin-top: 20px">保存</el-button>
            </el-tab-pane>
            <el-tab-pane label="数据库" name="database" v-if="gangweiSelect.includes('数据库')">
              <h3>数据库运维事件</h3>
              <div v-if="showDatabaseEventChart==true" style="height: 300px; width: 100%">
                <ECharts :option="databaseEventOption" />
              </div>
              <span v-if="showDatabaseEventChart==true" >注：从上图不难发现，数据库运维事件中TOP1为{{databaseTopData.t1name}}占{{databaseTopData.t1num}}件，TOP2为{{databaseTopData.t2name}}占{{databaseTopData.t2num}}件，TOP3为{{databaseTopData.t3name}}占{{databaseTopData.t3num}}件。</span>
              <WangEditor v-model:value="dbEvent" height="400px" width="300px" style="min-height: 300px" />
              <h3>数据库运维专项工作</h3>
              <div v-if="showDatabaseWorkChart==true" style="height: 300px; width: 100%">
                <ECharts :option="databaseWorkOption" />
              </div>
              <span v-if="showDatabaseWorkChart==true" >注：从上图不难发现，数据库运维专项工作中TOP1为{{databaseWorkTopData.t1name}}占{{databaseWorkTopData.t1num}}件，TOP2为{{databaseWorkTopData.t2name}}占{{databaseWorkTopData.t2num}}件，TOP3为{{databaseWorkTopData.t3name}}占{{databaseWorkTopData.t3num}}件。</span>
              <WangEditor v-model:value="dbWork" height="400px" width="300px" style="min-height: 300px" />
              <h3>数据库运维存在问题</h3>
              <div v-if="showDatabaseProblemChart==true" style="height: 300px; width: 100%">
                <ECharts :option="databaseProblemOption" />
              </div>
              <span v-if="showDatabaseProblemChart==true" >注：从上图不难发现，数据库运维存在问题中TOP1为{{databaseProblemTopData.t1name}}占{{databaseProblemTopData.t1num}}件，TOP2为{{databaseProblemTopData.t2name}}占{{databaseProblemTopData.t2num}}件，TOP3为{{databaseProblemTopData.t3name}}占{{databaseProblemTopData.t3num}}件。</span>
              <WangEditor v-model:value="dbProblem" height="400px" width="300px" style="min-height: 300px" />
              <h3>数据库运维重点事件回顾及解决方案</h3>
              <div v-if="showDatabaseSolutionChart==true" style="height: 300px; width: 100%">
                <ECharts :option="databaseSolutionOption" />
              </div>
              <span v-if="showDatabaseSolutionChart==true" >注：从上图不难发现，数据库运维重点事件回顾及解决方案中TOP1为{{databaseSolutionTopData.t1name}}占{{databaseSolutionTopData.t1num}}件，TOP2为{{databaseSolutionTopData.t2name}}占{{databaseSolutionTopData.t2num}}件，TOP3为{{databaseSolutionTopData.t3name}}占{{databaseSolutionTopData.t3num}}件。</span>
              <WangEditor v-model:value="dbSolution" height="400px" width="300px" style="min-height: 400px" />
              <h3>数据库运维重点事件下{{ typeText }}计划</h3>
              <div v-if="showDatabasePlanChart==true" style="height: 300px; width: 100%">
                <ECharts :option="databasePlanOption" />
              </div>
              <span v-if="showDatabasePlanChart==true" >注：从上图不难发现，数据库运维重点事件下{{ typeText }}计划中TOP1为{{databasePlanTopData.t1name}}占{{databasePlanTopData.t1num}}件，TOP2为{{databasePlanTopData.t2name}}占{{databasePlanTopData.t2num}}件，TOP3为{{databasePlanTopData.t3name}}占{{databasePlanTopData.t3num}}件。</span>
              <WangEditor v-model:value="dbPlan" height="400px" width="300px" style="min-height: 300px" />
              <el-button type="primary" :icon="View" @click="subDailyWorkForm(4)" style="margin-top: 20px">保存</el-button>
            </el-tab-pane> -->
            <!-- <template v-for="(tab, tabIndex) in tabsData" :key="tabIndex">
              <el-tab-pane  :label="tab.tabTitle" :name="tabIndex.toString()" v-if="gangweiSelect.includes(tabsData.title)">
              <div
                v-for="(editorData, editorIndex) in tab.wangEditorContent"
                :key="editorIndex"
                class="item"
                style="border-bottom: 1px solid #cbcaca"
              >
                <div class="item_label">{{ editorData.name }}</div>
                <div class="item-content" v-html="editorData.content"></div>
              </div>
            </el-tab-pane>
            </template> -->

            <el-tab-pane v-for="(tab, tabIndex) in tabsData" :key="tabIndex" :label="tab.tabTitle" :name="tabIndex.toString()">
              <div v-for="(editorData, editorIndex) in tab.wangEditorContent" :key="editorIndex">
                <h3 :for="'editor-' + editorData.id">{{ editorData.name }}:</h3>

                <div v-if="editorData.show" style=" width: 100%;height: 300px">
                  <ECharts :option="editorData.option" />
                </div>
                <span v-if="editorData.show"
                  >注：从上图不难发现，桌面运维事件中TOP1为{{ editorData.appTopData.t1name }}占{{
                    editorData.appTopData.t1num
                  }}件，TOP2为{{ editorData.appTopData.t2name }}占{{ editorData.appTopData.t2num }}件，TOP3为{{
                    editorData.appTopData.t3name
                  }}占{{ editorData.appTopData.t3num }}件。</span
                >
                <WangEditor :id="'editor-' + editorData.id" v-model:value="editorData.content" />
              </div>
              <!-- <h3>本页为扩展页数据联动其它页面一起保存，如需保存请前往其它页面点击保存按钮，</h3> -->
              <el-button type="primary" @click="subDailyWorkForm(tab.tabTitle)">保存</el-button>
            </el-tab-pane>
          </el-tabs>
          <!-- <div>
		      <el-tabs v-model="activeTab" @tab-click="handleTabClick">
		        <el-tab-pane
		          v-for="(tab, tabIndex) in tabsData"
		          :key="tabIndex"
		          :label="tab.tabTitle"
		          :name="tabIndex.toString()"
		        >
		          <div v-for="(editorData, editorIndex) in tab.wangEditorContent" :key="editorIndex">
		            <label :for="'editor-' + editorData.id">{{ editorData.id }}:</label>
		            <WangEditor
		              :id="'editor-' + editorData.id"
					  v-model:value="editorData.content"
		            />
		            <button @click="getEditorContent(tabIndex,editorIndex)">获取内容</button>
		            <button @click="setEditorContent('editor-' + editorData.id, '新内容')">设置内容</button>
		          </div>
				  
		        </el-tab-pane>
		      </el-tabs>
		    </div> -->
        </div>
      </el-drawer>
      <el-drawer v-model="dialogDetailVisible" title="报告详情" size="1000">
        <h3>基本信息</h3>
        <div>报告类型：{{ leixing }}</div>
        <div>报告人：{{ formDetail.ribaoName }}</div>
        <div style="width: 100%; margin-top: 10px">
          <el-tabs v-model="activeDetailName" class="demo-tabs" @tab-click="handleClick">
            <!-- <el-tab-pane label="桌面" name="deskTop_Detail" v-if="gangweiSelect.includes('桌面')">
              <div v-if="showoptionChart==true"  style="height: 300px; width: 100%">
                <ECharts :option="option"  />
              </div>
              <div class="item">
                <div class="item_label">桌面运维事件</div>
                <div class="item-content" v-html="formDetail.request_tongji_zhuomian"></div>
              </div>
              <div v-if="showDeskWorkChart==true" style="height: 300px; width: 100%">
                <ECharts :option="deskWorkOption" />
              </div>
              <div class="item">
                <div class="item_label">桌面运维专项工作</div>
                <div class="item-content" v-html="formDetail.special_tongji_zhuomian"></div>
              </div>
              <div v-if="showDeskProblemChart==true" style="height: 300px; width: 100%">
                <ECharts :option="deskProblemOption" />
              </div>
              <div class="item">
                <div class="item_label">桌面运维存在问题</div>
                <div class="item-content" v-html="formDetail.problem_tongji_zhuomian"></div>
              </div>
              <div v-if="showDeskSolutionChart==true" style="height: 300px; width: 100%">
                <ECharts :option="deskSolutionOption" />
              </div>
              <div class="item">
                <div class="item_label">桌面运维重点事件回顾及解决方案</div>
                <div class="item-content" v-html="formDetail.solution_tongji_zhuomian"></div>
              </div>
                <div v-if="showDeskPlanChart==true" style="height: 300px; width: 100%">
                <ECharts :option="deskPlanOption" />
              </div>
              <div class="item" style="border-bottom: 1px solid #cbcaca">
                <div class="item_label">桌面运维重点事件下{{ detailTypeText }}计划</div>
                <div class="item-content" v-html="formDetail.plan_tongji_zhuomian"></div>
              </div>
            </el-tab-pane>
            <el-tab-pane label="基础" name="base_Detail" v-if="gangweiSelect.includes('基础')">
              <div v-if="showBaseEventChart==true" style="height: 300px; width: 100%">
                <ECharts :option="baseEventOption" />
              </div>
              <div class="item">
                <div class="item_label">基础运维事件</div>
                <div class="item-content" v-html="formDetail.request_tongji_jichu"></div>
              </div>
             <div v-if="showBaseWorkChart==true" style="height: 300px; width: 100%">
                <ECharts :option="baseWorkOption" />
              </div>
              <div class="item">
                <div class="item_label">基础运维专项工作</div>
                <div class="item-content" v-html="formDetail.special_tongji_jichu"></div>
              </div>
              <div v-if="showBaseProblemChart==true" style="height: 300px; width: 100%">
                <ECharts :option="baseProblemOption" />
              </div>
              <div class="item">
                <div class="item_label">基础运维存在问题</div>
                <div class="item-content" v-html="formDetail.problem_tongji_jichu"></div>
              </div>
            <div v-if="showBaseSolutionChart==true" style="height: 300px; width: 100%">
                <ECharts :option="baseSolutionOption" />
              </div>
              <div class="item">
                <div class="item_label">基础运维重点事件回顾及解决方案</div>
                <div class="item-content" v-html="formDetail.solution_tongji_jichu"></div>
              </div>
              <div v-if="showBasePlanChart==true" style="height: 300px; width: 100%">
                <ECharts :option="basePlanOption" />
              </div>
              <div class="item" style="border-bottom: 1px solid #cbcaca">
                <div class="item_label">基础运维重点事件下{{ detailTypeText }}计划</div>
                <div class="item-content" v-html="formDetail.plan_tongji_jichu"></div>
              </div>
              
            </el-tab-pane>
            <el-tab-pane label="网络" name="network_Detail" v-if="gangweiSelect.includes('网络')">
              <div v-if="showNetworkEventChart==true" style="height: 300px; width: 100%">
                <ECharts :option="networkEventOption" />
              </div>
              <div class="item">
                <div class="item_label">网络运维事件</div>
                <div class="item-content" v-html="formDetail.request_tongji_wangluo"></div>
              </div>
              <div v-if="showNetworkWorkChart==true" style="height: 300px; width: 100%">
                <ECharts :option="networkWorkOption" />
              </div>
              <div class="item">
                <div class="item_label">网络运维专项工作</div>
                <div class="item-content" v-html="formDetail.special_tongji_wangluo"></div>
              </div>
              <div v-if="showNetworkProblemChart==true" style="height: 300px; width: 100%">
                <ECharts :option="networkProblemOption" />
              </div>
              <div class="item">
                <div class="item_label">网络运维存在问题</div>
                <div class="item-content" v-html="formDetail.problem_tongji_wangluo"></div>
              </div>
              <div v-if="showNetworkSolutionChart==true" style="height: 300px; width: 100%">
                <ECharts :option="networkSolutionOption" />
              </div>
              <div class="item">
                <div class="item_label">网络运维重点事件回顾及解决方案</div>
                <div class="item-content" v-html="formDetail.solution_tongji_wangluo"></div>
              </div>
              <div v-if="showNetworkPlanChart==true" style="height: 300px; width: 100%">
                <ECharts :option="networkPlanOption" />
              </div>
              <div class="item" style="border-bottom: 1px solid #cbcaca">
                <div class="item_label">网络运维重点事件下{{ detailTypeText }}计划</div>
                <div class="item-content" v-html="formDetail.plan_tongji_wangluo"></div>
              </div>
              
            </el-tab-pane>
            <el-tab-pane label="应用" name="app_Detail" v-if="gangweiSelect.includes('应用')">
              <div v-if="showAppEventChart==true" style="height: 300px; width: 100%">
                <ECharts :option="appEventOption" />
              </div>
              <div class="item">
                <div class="item_label">应用运维事件</div>
                <div class="item-content" v-html="formDetail.request_tongji_yingyong"></div>
              </div>
              <div v-if="showAppWorkChart==true" style="height: 300px; width: 100%">
                <ECharts :option="appWorkOption" />
              </div>
              <div class="item">
                <div class="item_label">应用运维专项工作</div>
                <div class="item-content" v-html="formDetail.special_tongji_yingyong"></div>
              </div>
              <div v-if="showAppProblemChart==true" style="height: 300px; width: 100%">
                <ECharts :option="appProblemOption" />
              </div>
              <div class="item">
                <div class="item_label">应用运维存在问题</div>
                <div class="item-content" v-html="formDetail.problem_tongji_yingyong"></div>
              </div>
               <div v-if="showAppSolutionChart==true" style="height: 300px; width: 100%">
                <ECharts :option="appSolutionOption" />
              </div>
              <div class="item">
                <div class="item_label">应用运维重点事件回顾及解决方案</div>
                <div class="item-content" v-html="formDetail.solution_tongji_yingyong"></div>
              </div>
             <div v-if="showAppPlanChart==true" style="height: 300px; width: 100%">
                <ECharts :option="appPlanOption" />
              </div>
              <div class="item" style="border-bottom: 1px solid #cbcaca">
                <div class="item_label">应用运维重点事件下{{ detailTypeText }}计划</div>
                <div class="item-content" v-html="formDetail.plan_tongji_yingyong"></div>
              </div>
              
            </el-tab-pane>
            <el-tab-pane label="数据库" name="database_Detail" v-if="gangweiSelect.includes('数据库')">
              <div v-if="showDatabaseEventChart==true" style="height: 300px; width: 100%">
                <ECharts :option="databaseEventOption" />
              </div>
              <div class="item">
                <div class="item_label">数据库运维事件</div>
                <div class="item-content" v-html="formDetail.request_tongji_shujuku"></div>
              </div>
              <div v-if="showDatabaseWorkChart==true" style="height: 300px; width: 100%">
                <ECharts :option="databaseWorkOption" />
              </div>
              <div class="item">
                <div class="item_label">数据库运维专项工作</div>
                <div class="item-content" v-html="formDetail.special_tongji_shujuku"></div>
              </div>
               <div v-if="showDatabaseProblemChart==true" style="height: 300px; width: 100%">
                <ECharts :option="databaseProblemOption" />
              </div>
              <div class="item">
                <div class="item_label">数据库运维存在问题</div>
                <div class="item-content" v-html="formDetail.problem_tongji_shujuku"></div>
              </div>
             <div v-if="showDatabaseSolutionChart==true" style="height: 300px; width: 100%">
                <ECharts :option="databaseSolutionOption" />
              </div>
              <div class="item">
                <div class="item_label">数据库运维重点事件回顾及解决方案</div>
                <div class="item-content" v-html="formDetail.solution_tongji_shujuku"></div>
              </div>
               <div v-if="showDatabasePlanChart==true" style="height: 300px; width: 100%">
                <ECharts :option="databasePlanOption" />
              </div>
              <div class="item" style="border-bottom: 1px solid #cbcaca">
                <div class="item_label">数据库运维重点事件下{{ detailTypeText }}计划</div>
                <div class="item-content" v-html="formDetail.plan_tongji_shujuku"></div>
              </div>
            </el-tab-pane> -->

            <!-- <template v-for="(tab, tabIndex) in tabsData" :key="tabIndex">
              <el-tab-pane  :label="tab.tabTitle" :name="tabIndex.toString()" v-if="gangweiSelect.includes(tabsData.title)">
              <div
                v-for="(editorData, editorIndex) in tab.wangEditorContent"
                :key="editorIndex"
                class="item"
                style="border-bottom: 1px solid #cbcaca"
              >
                <div class="item_label">{{ editorData.name }}</div>
                <div class="item-content" v-html="editorData.content"></div>
              </div>
            </el-tab-pane>
            </template> -->
            <el-tab-pane v-for="(tab, tabIndex) in tabsData" :key="tabIndex" :label="tab.tabTitle" :name="tabIndex.toString()">
              <div v-for="(editorData, editorIndex) in tab.wangEditorContent" :key="editorIndex">
                <div v-if="editorData.show" style=" width: 100%;height: 300px">
                  <ECharts :option="editorData.option" />
                </div>
                <span v-if="editorData.show"
                  >注：从上图不难发现，桌面运维事件中TOP1为{{ editorData.appTopData.t1name }}占{{
                    editorData.appTopData.t1num
                  }}件，TOP2为{{ editorData.appTopData.t2name }}占{{ editorData.appTopData.t2num }}件，TOP3为{{
                    editorData.appTopData.t3name
                  }}占{{ editorData.appTopData.t3num }}件。</span
                >
                <div class="item">
                  <div class="item_label">{{ editorData.name }}</div>
                  <div class="item-content" v-html="editorData.content"></div>
                </div>
              </div>
            </el-tab-pane>
          </el-tabs>
        </div>
      </el-drawer>
    </div>
    <el-dialog title="导出日/周/月文档" v-model="dialogTableVisible">
      <div :style="{ height: '300px' }">
        <el-form style="width: 100%" label-width="120px" ref="ruleFormRef" :rules="rules" :model="exportDataForm">
          <el-form-item label="文档类型 :" prop="downLoadPdfFlag">
            <el-select v-model="exportDataForm.downLoadPdfFlag" clearable placehoder="请选择" size="large" style="width: 180px">
              <el-option label="Word" value="0" />
              <el-option label="PDF" value="1" />
            </el-select>
          </el-form-item>
          <el-form-item label="报告类型 :" prop="leixing">
            <el-select v-model="exportDataForm.leixing" clearable placehoder="请选择" size="large" style="width: 180px">
              <el-option label="日报" value="0" />
              <el-option label="周报" value="1" />
              <el-option label="月报" value="2" />
            </el-select>
          </el-form-item>
          <el-form-item label="日报时间 :" prop="ribaoDate" v-if="exportDataForm.leixing == '0'">
            <el-date-picker
              v-model="exportDataForm.ribaoDate"
              type="date"
              placeholder="选择日期"
              value-format="YYYY-MM-DD HH:mm:ss"
            />
          </el-form-item>
          <el-form-item label="周报开始时间 :" prop="zhoubaoStartDate" v-if="exportDataForm.leixing == '1'">
            <el-date-picker
              v-model="exportDataForm.zhoubaoStartDate"
              type="date"
              placeholder="选择日期"
              value-format="YYYY-MM-DD HH:mm:ss"
            />
          </el-form-item>
          <el-form-item label="周报结束时间 :" prop="zhoubaoEndDate" v-if="exportDataForm.leixing == '1'">
            <el-date-picker
              v-model="exportDataForm.zhoubaoEndDate"
              type="date"
              placeholder="选择日期"
              value-format="YYYY-MM-DD HH:mm:ss"
            />
          </el-form-item>
          <el-form-item label="月报时间 :" prop="yuebaoDate" v-if="exportDataForm.leixing == '2'">
            <el-date-picker
              v-model="exportDataForm.yuebaoDate"
              type="month"
              placeholder="选择日期"
              value-format="YYYY-MM-DD HH:mm:ss"
            />
          </el-form-item>
          <el-button type="primary" @click="subexportDataForm(ruleFormRef)"> 确认 </el-button>
        </el-form>
      </div>
    </el-dialog>
  </div>
</template>
<script lang="ts" name="dailyWork" setup>
import { ref, reactive, onMounted, toRefs, watch, h, nextTick } from "vue";
import ProTable from "@/components/ProTable/index.vue";
import { ProTableInstance, ColumnProps } from "@/components/ProTable/interface";
import { ElMessage, ElMessageBox, ElNotification, ElDrawer, FormInstance, FormRules } from "element-plus";
import { useUserStore } from "@/stores/modules/user";
import type { FormProps, TabsPaneContext } from "element-plus";
import { Delete, EditPen, View, Search, Select } from "@element-plus/icons-vue";
import {
  getDailyWorkList,
  addDailyWork,
  editDailyWork,
  deleteDailyWork,
  getDailyWorkInfo,
  prdWord,
  findAttrs,
  findEavEntity,
  findPictureDataByName
} from "@/api/modules/dailyWork";
import WangEditor from "@/components/WangEditor/index.vue";
import { useDownload } from "@/hooks/useDownload";
import { IDomEditor } from "@wangeditor/editor";
import { getCurrentLoginUser } from "@/api/modules/accessController";
import { ECOption } from "@/components/ECharts/config";
import ECharts from "@/components/ECharts/index.vue";
// onMounted(() => {
//   console.log(1);
// });
// 各图表显示控制
const showoptionChart = ref(false);
const showDeskProblemChart = ref(false);
const showDeskSolutionChart = ref(false);
const showDeskPlanChart = ref(false);
const showBaseEventChart = ref(false);
const showBaseWorkChart = ref(false);
const showBaseProblemChart = ref(false);
const showBaseSolutionChart = ref(false);
const showBasePlanChart = ref(false);
const showNetworkEventChart = ref(false);
const showNetworkWorkChart = ref(false);
const showNetworkProblemChart = ref(false);
const showNetworkSolutionChart = ref(false);
const showNetworkPlanChart = ref(false);
const showAppEventChart = ref(false);
const showAppWorkChart = ref(false);
const showAppProblemChart = ref(false);
const showAppSolutionChart = ref(false);
const showAppPlanChart = ref(false);
const showDatabaseEventChart = ref(false);
const showDatabaseWorkChart = ref(false);
const showDatabaseProblemChart = ref(false);
const showDatabaseSolutionChart = ref(false);
const showDatabasePlanChart = ref(false);
const option = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["ont", "wot", "thr", "Thu", "Fri", "Sat", "Sun"]
  },
  yAxis: {
    interval: 20,
    type: "value"
  },
  series: [
    {
      data: [120, 200, 150, 80, 70, 110, 130],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 新增：桌面专项工作的动态图表开关与配置
const showDeskWorkChart = ref(false);
const deskWorkOption = ref<ECOption>({
  xAxis: { type: "category", data: [] },
  yAxis: { type: "value" },
  series: []
});

// 基础运维事件图表配置
const baseEventOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"]
  },
  yAxis: {
    interval: 20,
    type: "value"
  },
  series: [
    {
      data: [85, 120, 95, 150, 110, 80, 130],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 基础运维专项工作图表配置
const baseWorkOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["系统维护", "安全更新", "性能优化", "故障处理", "日常巡检"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [45, 78, 92, 65, 88],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 网络运维事件图表配置
const networkEventOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["网络中断", "带宽不足", "连接超时", "DNS解析", "防火墙"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [12, 25, 18, 32, 15],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 网络运维专项工作图表配置
const networkWorkOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["网络升级", "设备更换", "拓扑优化", "安全加固", "监控部署"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [65, 42, 88, 73, 56],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 应用运维事件图表配置
const appEventOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["应用崩溃", "响应缓慢", "登录失败", "数据异常", "接口超时"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [28, 45, 33, 67, 52],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 应用运维专项工作图表配置
const appWorkOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["版本更新", "性能调优", "功能测试", "部署上线", "监控告警"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [78, 95, 62, 88, 73],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 数据库运维事件图表配置
const databaseEventOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["连接超时", "查询缓慢", "锁等待", "空间不足", "备份失败"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [15, 38, 22, 45, 18],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 数据库运维专项工作图表配置
const databaseWorkOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["性能优化", "索引重建", "数据清理", "备份恢复", "监控配置"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [82, 67, 93, 58, 76],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 桌面运维存在问题图表配置
const deskProblemOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["硬件故障", "软件兼容", "性能下降", "安全漏洞", "用户操作"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [25, 42, 38, 15, 33],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 桌面运维重点事件回顾及解决方案图表配置
const deskSolutionOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["系统升级", "故障恢复", "性能优化", "安全加固", "用户培训"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [88, 95, 72, 85, 68],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 桌面运维重点事件下计划图表配置
const deskPlanOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["预防维护", "技术更新", "流程优化", "监控完善", "应急响应"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [75, 82, 90, 78, 85],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 基础运维存在问题图表配置
const baseProblemOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["系统不稳定", "资源不足", "配置错误", "监控缺失", "备份失败"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [18, 35, 28, 42, 25],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 基础运维重点事件回顾及解决方案图表配置
const baseSolutionOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["系统重构", "资源扩容", "配置优化", "监控部署", "备份策略"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [92, 78, 85, 90, 82],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 基础运维重点事件下计划图表配置
const basePlanOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["架构优化", "自动化部署", "灾备建设", "性能监控", "安全防护"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [85, 90, 75, 88, 92],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 网络运维存在问题图表配置
const networkProblemOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["网络延迟", "丢包严重", "带宽瓶颈", "设备老化", "配置冲突"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [22, 38, 45, 28, 35],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 网络运维重点事件回顾及解决方案图表配置
const networkSolutionOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["网络优化", "设备升级", "带宽扩容", "配置统一", "监控完善"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [88, 75, 92, 85, 90],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 网络运维重点事件下计划图表配置
const networkPlanOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["SDN部署", "5G网络", "安全防护", "自动化运维", "性能优化"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [80, 85, 92, 78, 88],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 应用运维存在问题图表配置
const appProblemOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["响应超时", "内存泄漏", "并发不足", "数据异常", "接口错误"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [32, 28, 45, 38, 42],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 应用运维重点事件回顾及解决方案图表配置
const appSolutionOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["性能调优", "内存优化", "并发提升", "数据修复", "接口重构"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [85, 78, 92, 88, 75],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 应用运维重点事件下计划图表配置
const appPlanOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["微服务化", "容器部署", "CI/CD优化", "监控告警", "自动化测试"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [90, 85, 88, 92, 78],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 数据库运维存在问题图表配置
const databaseProblemOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["性能瓶颈", "存储不足", "连接池满", "死锁问题", "数据不一致"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [35, 42, 28, 18, 32],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 数据库运维重点事件回顾及解决方案图表配置
const databaseSolutionOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["SQL优化", "存储扩容", "连接池调优", "死锁预防", "数据同步"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [88, 75, 82, 90, 85],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

// 数据库运维重点事件下计划图表配置
const databasePlanOption = ref<ECOption>({
  xAxis: {
    type: "category",
    data: ["读写分离", "分库分表", "缓存优化", "备份策略", "监控完善"]
  },
  yAxis: {
    type: "value"
  },
  series: [
    {
      data: [85, 78, 92, 88, 90],
      type: "bar"
    }
  ],
  resize: {
    width: "100%",
    height: "100%"
  }
});

//动态生成结束
// 定义数据结构
interface WangEditorContent {
  id: string;
  content: string;
  name: string;
  option: ECOption;
  show: Boolean;
  appTopData: topObj;
}
interface topObj {
  t1name: string;
  t2name: string;
  t3name: string;
  t1num: string;
  t2num: string;
  t3num: string;
}

interface TabData {
  tabTitle: string;
  wangEditorContent: WangEditorContent[];
}

// 存储 WangEditor 实例
const editorInstances = reactive<{ [id: string]: IDomEditor }>({});

// 后端数据
const tabsData = reactive<TabData[]>([]);

// 模拟从后端获取数据
// const fetchTabsData = () => {
//   return new Promise<TabData[]>(resolve => {
//     setTimeout(() => {
//       const backendData: TabData[] = [
//         {
//           tabTitle: "Tab 1",
//           wangEditorContent: [
//             { id: "eav_1724900400974", content: "内容1", name: "1.1" },
//             { id: "eav_1724749023470", content: "内容2", name: "1.2" }
//           ]
//         },
//         {
//           tabTitle: "Tab 2",
//           wangEditorContent: [
//             { id: "eav_1724748743312", content: "内容3", name: "1.3" },
//             { id: "eav_1727249755350", content: "内容4", name: "1.4" }
//           ]
//         }
//       ];
//       resolve(backendData);
//     }, 500);
//   });
// };
export interface resList {
  desc: string;
  companyName: string;
  eavName: string;
  companyNo: string;

  lastUpdater: string;
  parentEavName: string;
  parentEavNo: string;
  dataFlag: string;
  attributes: string;

  attrAsName: string;
  attrName: string;
  description: string;
  eavNo: string;
  attrNo: string;
}
// 当前激活的 Tab
const activeTab = ref("0");
const gangweiSelect = ref<any>([]);
const gangweiData = ref<any>([
  { label: "桌面", value: "桌面" },
  { label: "基础", value: "基础" },
  { label: "网络", value: "网络" },
  { label: "应用", value: "应用" },
  { label: "数据库", value: "数据库" }
]);

// 组件挂载后获取数据
onMounted(async () => {
  gangweiSelect.value = [];
  gangweiData.value = [
    { label: "桌面", value: "桌面" },
    { label: "基础", value: "基础" },
    { label: "网络", value: "网络" },
    { label: "应用", value: "应用" },
    { label: "数据库", value: "数据库" }
  ];

  // const data = await fetchTabsData();
  // tabsData.push(...data);
  findEavEntity().then(newParams => {
    let res = JSON.parse(JSON.stringify(newParams));
    res.data.forEach((child: any) => {
      console.log(child);
      let resdata = JSON.parse(JSON.stringify(child));
      if (resdata.desc != "系统数据" && resdata.desc != "") {
        gangweiData.value.push({ label: resdata.eavName, value: resdata.eavName });
      }
    });

    getCurrentLoginUser().then(resuser => {
      let newRes = JSON.parse(JSON.stringify(resuser));
      console.log(newRes.userRoles);
      console.log(newRes.loginName);
      if (newRes.loginName == "admin") {
        gangweiData.value.forEach((childgangweiData: any) => {
          let reschildchildgangweiData = JSON.parse(JSON.stringify(childgangweiData));
          gangweiSelect.value.push(reschildchildgangweiData.label.toString());
        });
        // gangweiSelect.value=gangweiData.value
        console.log("gangweiSelect.valu");
        console.log(gangweiSelect.value);
      } else {
        (newRes.userRoles as any).forEach(item => {
          let newitem = JSON.parse(JSON.stringify(item));
          console.log(newitem.gangweistr);
          gangweiData.value.forEach((child2: any) => {
            let reschild2 = JSON.parse(JSON.stringify(child2));
            if (newitem.gangweistr.includes(reschild2.value.toString())) {
              gangweiSelect.value.push(reschild2.label.toString());
            }
          });
        });
        console.log("gangweiSelect.valu");
        console.log(gangweiSelect.value);
      }

      res.data.forEach((child: resList) => {
        console.log(child);
        if (child.desc != "系统数据" && child.desc != "") {
          setTimeout(() => {
            findAttrs(child.eavNo).then(newParamsresfindAttrs => {
              let wangdata: WangEditorContent[] = [];
              let resfindAttrs = JSON.parse(JSON.stringify(newParamsresfindAttrs));
              resfindAttrs.data.forEach((childAttrs: resList) => {
                wangdata.push({
                  id: childAttrs.attrName,
                  content: "",
                  name: childAttrs.attrAsName,
                  show: false,
                  option: {
                    xAxis: {
                      type: "category",
                      data: ["ont", "wot", "thr", "Thu", "Fri", "Sat", "Sun"]
                    },
                    yAxis: {
                      interval: 10,
                      type: "value"
                    },
                    series: [
                      {
                        data: [120, 200, 150, 80, 70, 110, 130],
                        type: "bar"
                      }
                    ],
                    resize: {
                      width: "100%",
                      height: "100%"
                    }
                  },
                  appTopData: {
                    t1name: "",
                    t2name: "",
                    t3name: "",
                    t1num: "",
                    t2num: "",
                    t3num: ""
                  }
                });
              });
              console.log("333333333333333333333");
              console.log(gangweiSelect.value);
              console.log(child);
              console.log(child.eavName);
              console.log(gangweiSelect.value.includes(child.eavName));
              if (wangdata.length > 0 && gangweiSelect.value.includes(child.eavName)) {
                console.log("888888888888888888");
                tabsData.push({ tabTitle: child.desc, wangEditorContent: wangdata });
              }
              console.log("66666666666666");
              console.log(tabsData);
            });
          }, 120);
        }
      });
    });
  });
  //   findEavEntity().then(newParams => {
  //     let res = JSON.parse(JSON.stringify(newParams));
  //     res.data.forEach((child: any) => {
  //       console.log(child);
  //       let resdata = JSON.parse(JSON.stringify(child));
  //       if (resdata.desc != "系统数据" && resdata.desc != "") {
  //         gangweiData.value.push({label:resdata.eavName,value:resdata.eavName})
  //       }
  //     });

  //     getCurrentLoginUser().then(res => {
  //       let newRes = JSON.parse(JSON.stringify(res));
  //       console.log(newRes.userRoles);
  //       console.log(newRes.loginName);
  //       if(newRes.loginName=="admin"){
  //         gangweiSelect.value=gangweiData.value
  //         console.log("gangweiSelect.valu")
  //                 console.log(gangweiSelect.value)
  //       }else{
  //         (newRes.userRoles as any).forEach(item=>{
  //                   let newitem = JSON.parse(JSON.stringify(item));
  //                     console.log(newitem.gangweistr);
  //                     gangweiData.value.forEach((child2: any) => {
  //                       let reschild2 = JSON.parse(JSON.stringify(child2));
  //                       if(newitem.gangweistr.includes(reschild2.value.toString()) ){
  //                           gangweiSelect.value.push(reschild2.value.toString())
  //                       }
  //                     })
  //                 })
  //                 console.log("gangweiSelect.valu")
  //                 console.log(gangweiSelect.value)
  //       }

  //     });
  // });
});

// WangEditor 创建完成
const handleEditorCreated = (editor: IDomEditor, id: string) => {
  editorInstances[id] = editor;
};

// WangEditor 内容改变
const handleEditorChange = (content: string, id: string) => {
  // 在这里可以更新 tabsData 中对应 WangEditor 的内容
  tabsData.forEach(tab => {
    tab.wangEditorContent.forEach(editorContent => {
      if (editorContent.id === id.replace("editor-", "")) {
        editorContent.content = content;
      }
    });
  });
  console.log(`Editor ${id} 内容已更新：`, content);
};

// 获取 WangEditor 内容
const getEditorContent = (id: any, ie: any) => {
  console.log(id);
  console.log(ie);
  console.log(tabsData);
  console.log(tabsData[id].wangEditorContent[ie]);
  tabsData[id].wangEditorContent[ie].content = "<p>ddddddddddddddd</p>";
  // const editor = editorInstances[id];
  // if (editor) {
  //   alert(`Editor ${id} 内容：${editor.getHtml()}`);
  // } else {
  //   alert(`Editor ${id} 实例未找到`);
  // }
};

// // 设置 WangEditor 内容
// const setEditorContent = (id: string, content: string) => {
//   const editor = editorInstances[id];
//   if (editor) {
//     editor.txt.html(content);
//     // 同时更新 tabsData 中的数据
//     tabsData.forEach((tab) => {
//       tab.wangEditorContent.forEach((editorContent) => {
//         if (editorContent.id === id.replace('editor-', '')) {
//           editorContent.content = content;
//         }
//       });
//     });
//     alert(`Editor ${id} 内容已设置为：${content}`);
//   } else {
//     alert(`Editor ${id} 实例未找到`);
//   }
// };

// Tab 切换
const handleTabClick = (tab: any) => {
  activeTab.value = tab.props.name;
};

//动态生成结束

//导出文档
const ruleFormRef = ref<FormInstance>();
const dialogTableVisible = ref(false);
const exportDataForm = reactive({
  leixing: "",
  ribaoDate: "",
  zhoubaoStartDate: "",
  zhoubaoEndDate: "",
  yuebaoDate: "",
  downLoadPdfFlag: "0",
  downLoadPdf: false,
  orgNo: ""
});
const pictureDataForm = reactive({
  leixing: "",
  ribaoDate: "",
  zhoubaoStartDate: "",
  zhoubaoEndDate: "",
  yuebaoDate: "",
  downLoadPdfFlag: "0",
  downLoadPdf: false,
  orgNo: "",
  reportPictureShowName: ""
});

const rules = reactive<FormRules>({
  leixing: [{ required: true, message: "请选择报告类型", trigger: "blur" }],
  ribaoDate: [{ required: true, message: "请选择时间", trigger: "blur" }],
  zhoubaoStartDate: [{ required: true, message: "请选择时间", trigger: "blur" }],
  zhoubaoEndDate: [{ required: true, message: "请选择时间", trigger: "blur" }],
  yuebaoDate: [{ required: true, message: "请选择时间", trigger: "blur" }],
  downLoadPdfFlag: [{ required: true, message: "请选择类型", trigger: "blur" }]
});
const subexportDataForm = async (formEl: FormInstance | undefined) => {
  console.log(exportDataForm);
  if (!formEl) return;
  await formEl.validate((valid, fields) => {
    if (valid) {
      let type = ".docx";
      let name = "";
      exportDataForm.orgNo = userStore.userInfo.orgNo;
      if (exportDataForm.leixing == "0") {
        name = exportDataForm.ribaoDate + "日报";
      } else if (exportDataForm.leixing == "1") {
        name = exportDataForm.zhoubaoStartDate + "周报";
      } else {
        name = exportDataForm.yuebaoDate + "月报";
      }
      if (exportDataForm.downLoadPdfFlag == "1") {
        type = ".pdf";
        exportDataForm.downLoadPdf = true;
      } else {
        type = ".docx";
        exportDataForm.downLoadPdf = false;
      }
      useDownload(prdWord, name, exportDataForm, true, type);
    } else {
      ElMessage.error("请正确填写表单");
    }
  });
};
//导出文档结束

const userStore = useUserStore();
// ProTable 实例
const proTable = ref<ProTableInstance>();
const drawerRef = ref<InstanceType<typeof ElDrawer>>();
// 表格配置项
const columns = reactive<ColumnProps[]>([
  { type: "selection", fixed: "left" },
  { prop: "ribaouserName", label: "报告提交人", fixed: "left" },
  {
    prop: "leixing",
    label: "类型",
    render(h) {
      switch (h.row.leixing) {
        case 0:
          return "日报";
        case 1:
          return "周报";
        case 2:
          return "月报";
        default:
          return "未知";
      }
    }
  },
  { prop: "createdOn", label: "提交时间" },
  {
    prop: "zhuangtai",
    label: "状态",
    render(h) {
      switch (h.row.zhuangtai) {
        case 0:
          return "未填写";
        case 1:
          return "已填写";
        default:
          return "未知";
      }
    }
  },
  { prop: "operation", label: "操作", fixed: "right", width: 230 }
]);
//表格参数
const initParam = reactive({
  ecategoryName: 0,
  technicianNo: userStore.userInfo.userId
});
const dataCallback = (data: any) => {
  return {
    list: data.data,
    total: data.totalSize,
    pageNum: data.page,
    pageSize: data.rows
  };
};
//搜索
const ReportType = ref("");
const selectReportType = () => {
  console.log(ReportType.value);
  if (ReportType.value == "0") {
    initParam.ecategoryName = 0;
  }
  if (ReportType.value == "1") {
    initParam.ecategoryName = 1;
  }
  if (ReportType.value == "2") {
    initParam.ecategoryName = 2;
  }
  if (ReportType.value === undefined || ReportType.value === "") {
    initParam.ecategoryName = 0;
  }
};
//新增&编辑
const dialogVisible = ref(false);
const titleText = ref("");
const radio = ref(0);
const activeName = ref("base");
//
const dtEvent = ref("");
const dtWork = ref("");
const dtProblem = ref("");
const dtSolution = ref("");
const dtPlan = ref("");
//
const bsEvent = ref("");
const bsWork = ref("");
const bsProblem = ref("");
const bsSolution = ref("");
const bsPlan = ref("");
//
const ntEvent = ref("");
const ntWork = ref("");
const ntProblem = ref("");
const ntSolution = ref("");
const ntPlan = ref("");
//
const appEvent = ref("");
const appWork = ref("");
const appProblem = ref("");
const appSolution = ref("");
const appPlan = ref("");
//
const dbEvent = ref("");
const dbWork = ref("");
const dbProblem = ref("");
const dbSolution = ref("");
const dbPlan = ref("");
// 工具：获取当前时间并格式化为 yyyy-MM-dd HH:mm:ss
const formatDateTimeNow = (): string => {
  const date = new Date();
  const pad = (n: number) => (n < 10 ? "0" + n : "" + n);
  const yyyy = date.getFullYear();
  const MM = pad(date.getMonth() + 1);
  const dd = pad(date.getDate());
  const HH = pad(date.getHours());
  const mm = pad(date.getMinutes());
  const ss = pad(date.getSeconds());
  return `${yyyy}-${MM}-${dd} ${HH}:${mm}:${ss}`;
};

const pictureOpt = ref("");
const handleClick = (tab: TabsPaneContext, event: Event) => {
  reLoadPicture();
  console.log(tab, event);
};
const reLoadPicture = () => {
  if (pictureOpt.value == "add") {
    pictureDataForm.leixing = radio.value.toString();
    pictureDataForm.orgNo = userStore.userInfo.orgNo;
    if (radio.value == 0) {
      pictureDataForm.ribaoDate = formatDateTimeNow();
      console.log(pictureDataForm.ribaoDate);
    }
    if (radio.value == 1) {
      const now = new Date();
      const sevenDaysAgo = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
      const pad = (n: number) => (n < 10 ? "0" + n : "" + n);
      const format = (d: Date) =>
        `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;
      pictureDataForm.zhoubaoStartDate = format(sevenDaysAgo);
      pictureDataForm.zhoubaoEndDate = format(now);
      console.log(pictureDataForm.zhoubaoStartDate);
      console.log(pictureDataForm.zhoubaoEndDate);
    }
    if (radio.value == 2) {
      const now = new Date();
      const pad = (n: number) => (n < 10 ? "0" + n : "" + n);
      const yyyy = now.getFullYear();
      const MM = pad(now.getMonth() + 1);
      const dd = "01";
      pictureDataForm.yuebaoDate = `${yyyy}-${MM}-${dd} 00:00:00`;
      console.log(pictureDataForm.yuebaoDate);
    }
  }
  //   const pictureDataForm = reactive({
  //   leixing: radio.value,
  //   ribaoDate: "",
  //   zhoubaoStartDate: "",
  //   zhoubaoEndDate: "",
  //   yuebaoDate: "",
  //   downLoadPdfFlag: "0",
  //   downLoadPdf: false,
  //   orgNo: userStore.userInfo.orgNo,
  // });

  if (
    (activeName.value === "base" && (pictureOpt.value == "add" || pictureOpt.value == "edit")) ||
    (activeDetailName.value === "base_Detail" && pictureOpt.value == "see")
  ) {
    // 基础运维事件
    pictureDataForm.reportPictureShowName = "基础运维事件";
    showBaseEventChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        baseTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        baseTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        baseTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        baseTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        baseTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        baseTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (baseEventOption.value as any).xAxis = {
          ...(baseEventOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (baseEventOption.value as any).series = [{ type: "bar", data: JSON.parse(JSON.stringify(resdata.pictureData)) }];
        showBaseEventChart.value = true;
      }
    });
    // 基础运维专项工作
    pictureDataForm.reportPictureShowName = "基础运维专项工作";
    showBaseWorkChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        baseWorkTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        baseWorkTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        baseWorkTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        baseWorkTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        baseWorkTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        baseWorkTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (baseWorkOption.value as any).xAxis = {
          ...(baseWorkOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (baseWorkOption.value as any).series = [{ type: "bar", data: JSON.parse(JSON.stringify(resdata.pictureData)) }];
        showBaseWorkChart.value = true;
      }
    });
    // 基础运维存在问题
    pictureDataForm.reportPictureShowName = "基础运维存在问题";
    showBaseProblemChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        baseProblemTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        baseProblemTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        baseProblemTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        baseProblemTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        baseProblemTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        baseProblemTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (baseProblemOption.value as any).xAxis = {
          ...(baseProblemOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (baseProblemOption.value as any).series = [{ type: "bar", data: JSON.parse(JSON.stringify(resdata.pictureData)) }];
        showBaseProblemChart.value = true;
      }
    });
    // 基础运维重点事件回顾及解决方案
    pictureDataForm.reportPictureShowName = "基础运维重点事件回顾及解决方案";
    showBaseSolutionChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        baseSolutionTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        baseSolutionTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        baseSolutionTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        baseSolutionTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        baseSolutionTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        baseSolutionTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (baseSolutionOption.value as any).xAxis = {
          ...(baseSolutionOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (baseSolutionOption.value as any).series = [{ type: "bar", data: JSON.parse(JSON.stringify(resdata.pictureData)) }];
        showBaseSolutionChart.value = true;
      }
    });
    // 基础运维重点事件下计划
    pictureDataForm.reportPictureShowName = `基础运维重点事件下${typeText.value}计划`;
    showBasePlanChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        basePlanTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        basePlanTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        basePlanTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        basePlanTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        basePlanTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        basePlanTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (basePlanOption.value as any).xAxis = {
          ...(basePlanOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (basePlanOption.value as any).series = [{ type: "bar", data: JSON.parse(JSON.stringify(resdata.pictureData)) }];
        showBasePlanChart.value = true;
      }
    });
  }

  if (
    (activeName.value === "network" && (pictureOpt.value == "add" || pictureOpt.value == "edit")) ||
    (activeDetailName.value === "network_Detail" && pictureOpt.value == "see")
  ) {
    // 网络运维事件
    pictureDataForm.reportPictureShowName = "网络运维事件";
    showNetworkEventChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        networkTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        networkTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        networkTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        networkTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        networkTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        networkTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (networkEventOption.value as any).xAxis = {
          ...(networkEventOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (networkEventOption.value as any).series = [{ type: "bar", data: JSON.parse(JSON.stringify(resdata.pictureData)) }];
        showNetworkEventChart.value = true;
      }
    });
    // 网络运维专项工作
    pictureDataForm.reportPictureShowName = "网络运维专项工作";
    showNetworkWorkChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        networkWorkTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        networkWorkTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        networkWorkTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        networkWorkTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        networkWorkTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        networkWorkTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (networkWorkOption.value as any).xAxis = {
          ...(networkWorkOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (networkWorkOption.value as any).series = [{ type: "bar", data: JSON.parse(JSON.stringify(resdata.pictureData)) }];
        showNetworkWorkChart.value = true;
      }
    });
    // 网络运维存在问题
    pictureDataForm.reportPictureShowName = "网络运维存在问题";
    showNetworkProblemChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        networkProblemTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        networkProblemTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        networkProblemTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        networkProblemTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        networkProblemTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        networkProblemTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (networkProblemOption.value as any).xAxis = {
          ...(networkProblemOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (networkProblemOption.value as any).series = [{ type: "bar", data: JSON.parse(JSON.stringify(resdata.pictureData)) }];
        showNetworkProblemChart.value = true;
      }
    });
    // 网络运维重点事件回顾及解决方案
    pictureDataForm.reportPictureShowName = "网络运维重点事件回顾及解决方案";
    showNetworkSolutionChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        networkSolutionTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        networkSolutionTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        networkSolutionTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        networkSolutionTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        networkSolutionTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        networkSolutionTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (networkSolutionOption.value as any).xAxis = {
          ...(networkSolutionOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (networkSolutionOption.value as any).series = [{ type: "bar", data: JSON.parse(JSON.stringify(resdata.pictureData)) }];
        showNetworkSolutionChart.value = true;
      }
    });
    // 网络运维重点事件下计划
    pictureDataForm.reportPictureShowName = `网络运维重点事件下${typeText.value}计划`;
    showNetworkPlanChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        networkPlanTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        networkPlanTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        networkPlanTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        networkPlanTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        networkPlanTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        networkPlanTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (networkPlanOption.value as any).xAxis = {
          ...(networkPlanOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (networkPlanOption.value as any).series = [{ type: "bar", data: JSON.parse(JSON.stringify(resdata.pictureData)) }];
        showNetworkPlanChart.value = true;
      }
    });
  }

  if (
    (activeName.value === "app" && (pictureOpt.value == "add" || pictureOpt.value == "edit")) ||
    (activeDetailName.value === "app_Detail" && pictureOpt.value == "see")
  ) {
    // 应用运维事件
    pictureDataForm.reportPictureShowName = "应用运维事件";
    showAppEventChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        appTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        appTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        appTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        appTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        appTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        appTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (appEventOption.value as any).xAxis = {
          ...(appEventOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (appEventOption.value as any).series = [{ type: "bar", data: JSON.parse(JSON.stringify(resdata.pictureData)) }];
        showAppEventChart.value = true;
      }
    });
    // 应用运维专项工作
    pictureDataForm.reportPictureShowName = "应用运维专项工作";
    showAppWorkChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        appWorkTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        appWorkTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        appWorkTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        appWorkTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        appWorkTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        appWorkTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (appWorkOption.value as any).xAxis = {
          ...(appWorkOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (appWorkOption.value as any).series = [{ type: "bar", data: JSON.parse(JSON.stringify(resdata.pictureData)) }];
        showAppWorkChart.value = true;
      }
    });
    // 应用运维存在问题
    pictureDataForm.reportPictureShowName = "应用运维存在问题";
    showAppProblemChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        appProblemTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        appProblemTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        appProblemTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        appProblemTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        appProblemTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        appProblemTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (appProblemOption.value as any).xAxis = {
          ...(appProblemOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (appProblemOption.value as any).series = [{ type: "bar", data: JSON.parse(JSON.stringify(resdata.pictureData)) }];
        showAppProblemChart.value = true;
      }
    });
    // 应用运维重点事件回顾及解决方案
    pictureDataForm.reportPictureShowName = "应用运维重点事件回顾及解决方案";
    showAppSolutionChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        appSolutionTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        appSolutionTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        appSolutionTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        appSolutionTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        appSolutionTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        appSolutionTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (appSolutionOption.value as any).xAxis = {
          ...(appSolutionOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (appSolutionOption.value as any).series = [{ type: "bar", data: JSON.parse(JSON.stringify(resdata.pictureData)) }];
        showAppSolutionChart.value = true;
      }
    });
    // 应用运维重点事件下计划
    pictureDataForm.reportPictureShowName = `应用运维重点事件下${typeText.value}计划`;
    showAppPlanChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        appPlanTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        appPlanTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        appPlanTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        appPlanTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        appPlanTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        appPlanTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (appPlanOption.value as any).xAxis = {
          ...(appPlanOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (appPlanOption.value as any).series = [{ type: "bar", data: JSON.parse(JSON.stringify(resdata.pictureData)) }];
        showAppPlanChart.value = true;
      }
    });
  }

  if (
    (activeName.value === "database" && (pictureOpt.value == "add" || pictureOpt.value == "edit")) ||
    (activeDetailName.value === "database_Detail" && pictureOpt.value == "see")
  ) {
    // 数据库运维事件
    pictureDataForm.reportPictureShowName = "数据库运维事件";
    showDatabaseEventChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        databaseTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        databaseTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        databaseTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        databaseTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        databaseTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        databaseTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (databaseEventOption.value as any).xAxis = {
          ...(databaseEventOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (databaseEventOption.value as any).series = [{ type: "bar", data: JSON.parse(JSON.stringify(resdata.pictureData)) }];
        showDatabaseEventChart.value = true;
      }
    });
    // 数据库运维专项工作
    pictureDataForm.reportPictureShowName = "数据库运维专项工作";
    showDatabaseWorkChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        databaseWorkTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        databaseWorkTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        databaseWorkTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        databaseWorkTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        databaseWorkTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        databaseWorkTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (databaseWorkOption.value as any).xAxis = {
          ...(databaseWorkOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (databaseWorkOption.value as any).series = [{ type: "bar", data: JSON.parse(JSON.stringify(resdata.pictureData)) }];
        showDatabaseWorkChart.value = true;
      }
    });
    // 数据库运维存在问题
    pictureDataForm.reportPictureShowName = "数据库运维存在问题";
    showDatabaseProblemChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        databaseProblemTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        databaseProblemTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        databaseProblemTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        databaseProblemTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        databaseProblemTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        databaseProblemTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (databaseProblemOption.value as any).xAxis = {
          ...(databaseProblemOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (databaseProblemOption.value as any).series = [{ type: "bar", data: JSON.parse(JSON.stringify(resdata.pictureData)) }];
        showDatabaseProblemChart.value = true;
      }
    });
    // 数据库运维重点事件回顾及解决方案
    pictureDataForm.reportPictureShowName = "数据库运维重点事件回顾及解决方案";
    showDatabaseSolutionChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        databaseSolutionTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        databaseSolutionTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        databaseSolutionTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        databaseSolutionTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        databaseSolutionTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        databaseSolutionTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (databaseSolutionOption.value as any).xAxis = {
          ...(databaseSolutionOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (databaseSolutionOption.value as any).series = [{ type: "bar", data: JSON.parse(JSON.stringify(resdata.pictureData)) }];
        showDatabaseSolutionChart.value = true;
      }
    });
    // 数据库运维重点事件下计划
    pictureDataForm.reportPictureShowName = `数据库运维重点事件下${typeText.value}计划`;
    showDatabasePlanChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        databasePlanTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        databasePlanTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        databasePlanTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        databasePlanTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        databasePlanTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        databasePlanTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (databasePlanOption.value as any).xAxis = {
          ...(databasePlanOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (databasePlanOption.value as any).series = [{ type: "bar", data: JSON.parse(JSON.stringify(resdata.pictureData)) }];
        showDatabasePlanChart.value = true;
      }
    });
  }
  //       activeDetailName.value==="base_Detail"
  //
  if (
    (activeName.value === "deskTop" && (pictureOpt.value == "add" || pictureOpt.value == "edit")) ||
    (activeDetailName.value === "deskTop_Detail" && pictureOpt.value == "see")
  ) {
    pictureDataForm.reportPictureShowName = "桌面运维事件";
    showoptionChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        console.log(resdata.t1name);
        optionTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        optionTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        optionTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        optionTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        optionTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        optionTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (option.value as any).xAxis = {
          ...(option.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (option.value as any).series = [
          {
            type: "bar",
            data: JSON.parse(JSON.stringify(resdata.pictureData))
          }
        ];
        showoptionChart.value = true;
        console.log(optionTopData.value);
      }
    });
    // 桌面运维专项工作
    pictureDataForm.reportPictureShowName = "桌面运维专项工作";
    showDeskWorkChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        deskWorkTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        deskWorkTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        deskWorkTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        deskWorkTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        deskWorkTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        deskWorkTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (deskWorkOption.value as any).xAxis = {
          ...(deskWorkOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (deskWorkOption.value as any).series = [
          {
            type: "bar",
            data: JSON.parse(JSON.stringify(resdata.pictureData))
          }
        ];
        showDeskWorkChart.value = true;
      }
    });
    // 桌面运维存在问题
    pictureDataForm.reportPictureShowName = "桌面运维存在问题";
    showDeskProblemChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        deskProblemTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        deskProblemTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        deskProblemTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        deskProblemTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        deskProblemTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        deskProblemTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (deskProblemOption.value as any).xAxis = {
          ...(deskProblemOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (deskProblemOption.value as any).series = [
          {
            type: "bar",
            data: JSON.parse(JSON.stringify(resdata.pictureData))
          }
        ];
        showDeskProblemChart.value = true;
      }
    });
    // 桌面运维重点事件回顾及解决方案
    pictureDataForm.reportPictureShowName = "桌面运维重点事件回顾及解决方案";
    showDeskSolutionChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        deskSolutionTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        deskSolutionTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        deskSolutionTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        deskSolutionTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        deskSolutionTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        deskSolutionTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (deskSolutionOption.value as any).xAxis = {
          ...(deskSolutionOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (deskSolutionOption.value as any).series = [
          {
            type: "bar",
            data: JSON.parse(JSON.stringify(resdata.pictureData))
          }
        ];
        showDeskSolutionChart.value = true;
      }
    });
    // 桌面运维重点事件下计划（含日/周/月）
    pictureDataForm.reportPictureShowName = `桌面运维重点事件下${typeText.value}计划`;
    showDeskPlanChart.value = false;
    findPictureDataByName(pictureDataForm).then(res => {
      if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
      } else {
        let resdata = JSON.parse(res.toString());
        deskPlanTopData.value.t1name = resdata.t1name == undefined ? "" : resdata.t1name;
        deskPlanTopData.value.t2name = resdata.t2name == undefined ? "" : resdata.t2name;
        deskPlanTopData.value.t3name = resdata.t3name == undefined ? "" : resdata.t3name;
        deskPlanTopData.value.t1num = resdata.t1num == undefined ? "" : resdata.t1num.toString();
        deskPlanTopData.value.t2num = resdata.t2num == undefined ? "" : resdata.t2num.toString();
        deskPlanTopData.value.t3num = resdata.t3num == undefined ? "" : resdata.t3num.toString();
        (deskPlanOption.value as any).xAxis = {
          ...(deskPlanOption.value as any).xAxis,
          type: "category",
          data: JSON.parse(JSON.stringify(resdata.pictureName))
        };
        (deskPlanOption.value as any).series = [
          {
            type: "bar",
            data: JSON.parse(JSON.stringify(resdata.pictureData))
          }
        ];
        showDeskPlanChart.value = true;
      }
    });
  }
  (activeName.value === "deskTop" && (pictureOpt.value == "add" || pictureOpt.value == "edit")) ||
    (activeDetailName.value === "deskTop_Detail" && pictureOpt.value == "see");
  tabsData.forEach((child: TabData, idx) => {
    if (
      (activeName.value === idx.toString() && (pictureOpt.value == "add" || pictureOpt.value == "edit")) ||
      (activeDetailName.value === idx.toString() && pictureOpt.value == "see")
    ) {
      console.log("当前选择");
      console.log(child);
      child.wangEditorContent.forEach((childWangEditorContent: WangEditorContent, index) => {
        console.log(index);
        console.log(childWangEditorContent.name);
        pictureDataForm.reportPictureShowName = childWangEditorContent.name;
        // showDeskPlanChart.value=false;
        childWangEditorContent.show = false;
        findPictureDataByName(pictureDataForm).then(res => {
          if (res.toString() == "未找到名称" || res.toString() == "发生错误") {
          } else {
            let resdata = JSON.parse(res.toString());

            // appTopData:{
            //   t1name:"",
            //   t2name:"",
            //   t3name:"",
            //   t1num:"",
            //   t2num:"",
            //   t3num:""
            // }
            childWangEditorContent.appTopData = {
              t1name: resdata.t1name == undefined ? "" : resdata.t1name,
              t2name: resdata.t2name == undefined ? "" : resdata.t2name,
              t3name: resdata.t3name == undefined ? "" : resdata.t3name,
              t1num: resdata.t1num == undefined ? "" : resdata.t1num.toString(),
              t2num: resdata.t2num == undefined ? "" : resdata.t2num.toString(),
              t3num: resdata.t3num == undefined ? "" : resdata.t3num.toString()
            };

            (childWangEditorContent.option as any).xAxis = {
              ...(childWangEditorContent.option as any).xAxis,
              type: "category",
              data: JSON.parse(JSON.stringify(resdata.pictureName))
            };
            (childWangEditorContent.option as any).series = [
              {
                type: "bar",
                data: JSON.parse(JSON.stringify(resdata.pictureData))
              }
            ];
            // showDeskPlanChart.value=true;
            childWangEditorContent.show = true;
          }
        });
      });
    }
  });
};
const optionTopData = ref({
  t1name: "",
  t2name: "",
  t3name: "",
  t1num: "",
  t2num: "",
  t3num: ""
});
const baseTopData = ref({
  t1name: "",
  t2name: "",
  t3name: "",
  t1num: "",
  t2num: "",
  t3num: ""
});
const networkTopData = ref({
  t1name: "",
  t2name: "",
  t3name: "",
  t1num: "",
  t2num: "",
  t3num: ""
});
const appTopData = ref({
  t1name: "",
  t2name: "",
  t3name: "",
  t1num: "",
  t2num: "",
  t3num: ""
});
const databaseTopData = ref({
  t1name: "",
  t2name: "",
  t3name: "",
  t1num: "",
  t2num: "",
  t3num: ""
});
// 桌面
const deskWorkTopData = ref({ t1name: "", t2name: "", t3name: "", t1num: "", t2num: "", t3num: "" });
const deskProblemTopData = ref({ t1name: "", t2name: "", t3name: "", t1num: "", t2num: "", t3num: "" });
const deskSolutionTopData = ref({ t1name: "", t2name: "", t3name: "", t1num: "", t2num: "", t3num: "" });
const deskPlanTopData = ref({ t1name: "", t2name: "", t3name: "", t1num: "", t2num: "", t3num: "" });
// 基础
const baseWorkTopData = ref({ t1name: "", t2name: "", t3name: "", t1num: "", t2num: "", t3num: "" });
const baseProblemTopData = ref({ t1name: "", t2name: "", t3name: "", t1num: "", t2num: "", t3num: "" });
const baseSolutionTopData = ref({ t1name: "", t2name: "", t3name: "", t1num: "", t2num: "", t3num: "" });
const basePlanTopData = ref({ t1name: "", t2name: "", t3name: "", t1num: "", t2num: "", t3num: "" });
// 网络
const networkWorkTopData = ref({ t1name: "", t2name: "", t3name: "", t1num: "", t2num: "", t3num: "" });
const networkProblemTopData = ref({ t1name: "", t2name: "", t3name: "", t1num: "", t2num: "", t3num: "" });
const networkSolutionTopData = ref({ t1name: "", t2name: "", t3name: "", t1num: "", t2num: "", t3num: "" });
const networkPlanTopData = ref({ t1name: "", t2name: "", t3name: "", t1num: "", t2num: "", t3num: "" });
// 应用
const appWorkTopData = ref({ t1name: "", t2name: "", t3name: "", t1num: "", t2num: "", t3num: "" });
const appProblemTopData = ref({ t1name: "", t2name: "", t3name: "", t1num: "", t2num: "", t3num: "" });
const appSolutionTopData = ref({ t1name: "", t2name: "", t3name: "", t1num: "", t2num: "", t3num: "" });
const appPlanTopData = ref({ t1name: "", t2name: "", t3name: "", t1num: "", t2num: "", t3num: "" });
// 数据库
const databaseWorkTopData = ref({ t1name: "", t2name: "", t3name: "", t1num: "", t2num: "", t3num: "" });
const databaseProblemTopData = ref({ t1name: "", t2name: "", t3name: "", t1num: "", t2num: "", t3num: "" });
const databaseSolutionTopData = ref({ t1name: "", t2name: "", t3name: "", t1num: "", t2num: "", t3num: "" });
const databasePlanTopData = ref({ t1name: "", t2name: "", t3name: "", t1num: "", t2num: "", t3num: "" });
const reSetReportFormValue = () => {
  dtEvent.value = "";
  dtWork.value = "";
  dtProblem.value = "";
  dtSolution.value = "";
  dtPlan.value = "";
  bsEvent.value = "";
  bsWork.value = "";
  bsProblem.value = "";
  bsSolution.value = "";
  bsPlan.value = "";
  ntEvent.value = "";
  ntWork.value = "";
  ntProblem.value = "";
  ntSolution.value = "";
  ntPlan.value = "";
  appEvent.value = "";
  appWork.value = "";
  appProblem.value = "";
  appSolution.value = "";
  appPlan.value = "";
  dbEvent.value = "";
  dbWork.value = "";
  dbProblem.value = "";
  dbSolution.value = "";
  dbPlan.value = "";
};
const closeDrawer = () => {
  dialogVisible.value = false;
  activeName.value = "deskTop";
  proTable.value?.getTableList();
  reSetReportFormValue();
};
const changeRadio = (val: any) => {
  console.log(val);
  if (val === 0) {
    typeText.value = "日";
  }
  if (val === 1) {
    typeText.value = "周";
  }
  if (val === 2) {
    typeText.value = "月";
  }
  reLoadPicture();
};
const getplan = () => {
  console.log("getplan");

  // 获取所有 el-tab-pane 下面的 h3 标签
  const tabPanes = document.querySelectorAll("el-tab-pane");
  const allH3Tags: string[] = [];

  tabPanes.forEach((tabPane, index) => {
    const h3Tags = (tabPane as HTMLElement).querySelectorAll("h3");
    h3Tags.forEach((h3, h3Index) => {
      const h3Text = h3.textContent || (h3 as any).innerText;
      allH3Tags.push(`Tab ${index + 1} - H3 ${h3Index + 1}: ${h3Text}`);
      console.log(`Tab ${index + 1} - H3 ${h3Index + 1}:`, h3Text);
    });
  });

  console.log("所有H3标签内容:", allH3Tags);
  return allH3Tags;
};

// 新增：按钮"获取2"触发，在"桌面运维专项工作"标题下动态渲染图表并可更新配置
const getplan2 = () => {
  showDeskWorkChart.value = true;
  // 这里演示可动态修改 option（实际可替换为接口返回的数据）
  const categories = ["一月", "二月", "三月", "四月", "五月", "六月", "七月"];
  const data = categories.map(() => Math.floor(Math.random() * 300) + 50);
  deskWorkOption.value = {
    xAxis: { type: "category", data: categories },
    yAxis: { type: "value" },
    series: [{ type: "bar", data }],
    resize: { width: "100%", height: "100%" }
  } as ECOption;
};
const addReleaseBtn = () => {
  titleText.value = "新增报告";
  pictureOpt.value = "add";

  //清空
  tabsData.forEach((child: TabData) => {
    child.wangEditorContent.forEach((childWangEditorContent: WangEditorContent) => {
      childWangEditorContent.content = "";
    });
  });
  if (gangweiSelect.value.length > 0) {
    activeName.value = "0";
    //             if(gangweiSelect.value[0]=="桌面"){
    //               activeName.value="deskTop";
    //             }
    //             if(gangweiSelect.value[0]=="基础"){
    //               activeName.value="base";
    //             }
    //             if(gangweiSelect.value[0].toString()=="网络"){
    //               activeName.value="network";
    //             }
    //             if(gangweiSelect.value[0]=="应用"){
    //               activeName.value="app";
    //             }
    //             if(gangweiSelect.value[0]=="数据库"){
    //               activeName.value="database";
    //             }
    console.log("ssssss111111111111");
    console.log(activeName.value);
    console.log("ssssss111111111111");
    console.log(gangweiSelect.value);
  }

  //   findPictureDataByName({leixing: "1",zhoubaoStartDate: "2020-08-19 10:10:10",zhoubaoEndDate: "2025-08-25 10:10:10",reportPictureShowName:"日报第二章2.2",orgNo:"1"}).then(res => {
  //     let resdata = JSON.parse(res.toString());
  //     console.log(resdata);
  //     console.log(resdata.pictureName);
  //     console.log(resdata.pictureData);
  //   (option.value as any).xAxis = { ...(option.value as any).xAxis, type: "category", data: JSON.parse(JSON.stringify(resdata.pictureName)) };
  //   (option.value as any).series = [
  //     {
  //       type: "bar",
  //       data: JSON.parse(JSON.stringify(resdata.pictureData))
  //     }
  //   ];
  // });

  reLoadPicture();
  dialogVisible.value = true;
};
const id = ref();
const type = ref();
const typeText = ref("日");
const editEvent = (row: any) => {
  console.log(row);
  dialogVisible.value = true;
  titleText.value = "编辑报告";
  pictureOpt.value = "edit";

  if (pictureOpt.value == "edit") {
    pictureDataForm.leixing = row.leixing.toString();
    pictureDataForm.orgNo = row.ribaoOrgNo;
    if (row.leixing == 0) {
      pictureDataForm.ribaoDate = row.createdOn;
      console.log(pictureDataForm.ribaoDate);
    }
    if (row.leixing == 1) {
      const now = new Date();
      const sevenDaysAgo = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
      const pad = (n: number) => (n < 10 ? "0" + n : "" + n);
      const format = (d: Date) =>
        `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;

      const date = new Date(row.createdOn.replace(" ", "T"));
      pictureDataForm.zhoubaoStartDate = format(date);
      pictureDataForm.zhoubaoEndDate = row.createdOn;
      console.log(pictureDataForm.zhoubaoStartDate);
      console.log(pictureDataForm.zhoubaoEndDate);
    }
    if (row.leixing == 2) {
      const now = new Date(row.createdOn.replace(" ", "T"));
      const pad = (n: number) => (n < 10 ? "0" + n : "" + n);
      const yyyy = now.getFullYear();
      const MM = pad(now.getMonth() + 1);
      const dd = "01";
      pictureDataForm.yuebaoDate = `${yyyy}-${MM}-${dd} 00:00:00`;
      console.log(pictureDataForm.yuebaoDate);
    }
  }

  if (row) {
    id.value = row.id;
    type.value = row.leixing;
    if (row.leixing === 0) {
      typeText.value = "日";
    }
    if (row.leixing === 1) {
      typeText.value = "周";
    }
    if (row.leixing === 2) {
      typeText.value = "月";
    }
    dtEvent.value = row.request_tongji_zhuomian.replace(
      '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
      ""
    );
    console.log(dtEvent.value);
    dtWork.value = row.special_tongji_zhuomian;
    dtProblem.value = row.problem_tongji_zhuomian;
    dtSolution.value = row.solution_tongji_zhuomian;
    dtPlan.value = row.plan_tongji_zhuomian;
    bsEvent.value = row.request_tongji_jichu;
    bsWork.value = row.special_tongji_jichu;
    bsProblem.value = row.problem_tongji_jichu;
    bsSolution.value = row.solution_tongji_jichu;
    bsPlan.value = row.plan_tongji_jichu;
    ntEvent.value = row.request_tongji_wangluo;
    ntWork.value = row.special_tongji_wangluo;
    ntProblem.value = row.problem_tongji_wangluo;
    ntSolution.value = row.solution_tongji_wangluo;
    ntPlan.value = row.plan_tongji_wangluo;
    appEvent.value = row.request_tongji_yingyong;
    appWork.value = row.request_tongji_yingyong;
    appProblem.value = row.problem_tongji_yingyong;
    appSolution.value = row.solution_tongji_yingyong;
    appPlan.value = row.plan_tongji_yingyong;
    dbEvent.value = row.request_tongji_shujuku;
    dbWork.value = row.special_tongji_shujuku;
    dbProblem.value = row.problem_tongji_shujuku;
    dbSolution.value = row.solution_tongji_shujuku;
    dbPlan.value = row.plan_tongji_shujuku;

    const params = "requestId=" + row.id;
    getDailyWorkInfo(params).then(resdata => {
      let res = JSON.parse(JSON.stringify(resdata));
      if (res) {
        tabsData.forEach((child: TabData) => {
          child.wangEditorContent.forEach((childWangEditorContent: WangEditorContent) => {
            Object.keys(res.attrVals).forEach(key => {
              if (`${key}` == childWangEditorContent.id) {
                childWangEditorContent.content = `${res.attrVals[key]}` == undefined ? "" : `${res.attrVals[key]}`;
              }
            });
          });
        });
      }
    });
  }
  if (gangweiSelect.value.length > 0) {
    activeName.value = "0";
    //             if(gangweiSelect.value[0]=="桌面"){
    //               activeName.value="deskTop";
    //             }
    //             if(gangweiSelect.value[0]=="基础"){
    //               activeName.value="base";
    //             }
    //             if(gangweiSelect.value[0].toString()=="网络"){
    //               activeName.value="network";
    //             }
    //             if(gangweiSelect.value[0]=="应用"){
    //               activeName.value="app";
    //             }
    //             if(gangweiSelect.value[0]=="数据库"){
    //               activeName.value="database";
    //             }
  }
  reLoadPicture();
};
const subDailyWorkForm = async type => {
  //扩展自定义字段
  let eavparam = {};
  tabsData.forEach((child: TabData) => {
    console.log(child);
    child.wangEditorContent.forEach((childWangEditorContent: WangEditorContent) => {
      eavparam[childWangEditorContent.id] = childWangEditorContent.content;
    });
  });

  if (titleText.value == "新增报告") {
    let params;
    console.log(dtEvent.value);

    if (1 == 1) {
      params = {
        "yunweiZongJieDTO.request_tongji_zhuomian": dtEvent.value,
        "yunweiZongJieDTO.special_tongji_zhuomian": dtWork.value,
        "yunweiZongJieDTO.problem_tongji_zhuomian": dtProblem.value,
        "yunweiZongJieDTO.solution_tongji_zhuomian": dtSolution.value,
        "yunweiZongJieDTO.plan_tongji_zhuomian": dtPlan.value,
        "yunweiZongJieDTO.ribaoNo": userStore.userInfo.userId,
        "yunweiZongJieDTO.ribaoOrgNo": userStore.userInfo.orgNo,
        "yunweiZongJieDTO.ribaoOrgName": userStore.userInfo.orgName,
        "yunweiZongJieDTO.gangwei": type,
        "yunweiZongJieDTO.leixing": radio.value
      };
      let isNUll = true;
      Object.keys(eavparam).forEach(key => {
        if (`${eavparam[key]}` != "" && `${eavparam[key]}` != undefined && `${eavparam[key]}` != null) {
          isNUll = false;
        }
      });
      if (isNUll) {
        ElNotification({
          message: h("i", { style: "color: red" }, "请输入至少一条数据"),
          customClass: "http-message"
        });
        return;
      }
    }

    if (type === 0) {
      params = {
        "yunweiZongJieDTO.request_tongji_zhuomian": dtEvent.value,
        "yunweiZongJieDTO.special_tongji_zhuomian": dtWork.value,
        "yunweiZongJieDTO.problem_tongji_zhuomian": dtProblem.value,
        "yunweiZongJieDTO.solution_tongji_zhuomian": dtSolution.value,
        "yunweiZongJieDTO.plan_tongji_zhuomian": dtPlan.value,
        "yunweiZongJieDTO.ribaoNo": userStore.userInfo.userId,
        "yunweiZongJieDTO.ribaoOrgNo": userStore.userInfo.orgNo,
        "yunweiZongJieDTO.ribaoOrgName": userStore.userInfo.orgName,
        "yunweiZongJieDTO.gangwei": type,
        "yunweiZongJieDTO.leixing": radio.value
      };
      // 检查前五个参数是否为空
      if (
        !params["yunweiZongJieDTO.request_tongji_zhuomian"] &&
        !params["yunweiZongJieDTO.special_tongji_zhuomian"] &&
        !params["yunweiZongJieDTO.problem_tongji_zhuomian"] &&
        !params["yunweiZongJieDTO.solution_tongji_zhuomian"] &&
        !params["yunweiZongJieDTO.plan_tongji_zhuomian"]
      ) {
        ElNotification({
          message: h("i", { style: "color: red" }, "请输入至少一条数据"),
          customClass: "http-message"
        });
        return;
      }
    }
    if (type === 1) {
      params = {
        "yunweiZongJieDTO.request_tongji_jichu": bsEvent.value,
        "yunweiZongJieDTO.special_tongji_jichu": bsWork.value,
        "yunweiZongJieDTO.problem_tongji_jichu": bsProblem.value,
        "yunweiZongJieDTO.solution_tongji_jichu": bsSolution.value,
        "yunweiZongJieDTO.plan_tongji_jichu": bsPlan.value,
        "yunweiZongJieDTO.ribaoNo": userStore.userInfo.userId,
        "yunweiZongJieDTO.ribaoOrgNo": userStore.userInfo.orgNo,
        "yunweiZongJieDTO.ribaoOrgName": userStore.userInfo.orgName,
        "yunweiZongJieDTO.gangwei": type,
        "yunweiZongJieDTO.leixing": radio.value
      };
      if (
        !params["yunweiZongJieDTO.request_tongji_jichu"] &&
        !params["yunweiZongJieDTO.special_tongji_jichu"] &&
        !params["yunweiZongJieDTO.problem_tongji_jichu"] &&
        !params["yunweiZongJieDTO.solution_tongji_jichu"] &&
        !params["yunweiZongJieDTO.plan_tongji_jichu"]
      ) {
        ElNotification({
          message: h("i", { style: "color: red" }, "请输入至少一条数据"),
          customClass: "http-message"
        });
        return;
      }
    }
    if (type === 2) {
      params = {
        "yunweiZongJieDTO.request_tongji_wangluo": ntEvent.value,
        "yunweiZongJieDTO.special_tongji_wangluo": ntWork.value,
        "yunweiZongJieDTO.problem_tongji_wangluo": ntProblem.value,
        "yunweiZongJieDTO.solution_tongji_wangluo": ntSolution.value,
        "yunweiZongJieDTO.plan_tongji_wangluo": ntPlan.value,
        "yunweiZongJieDTO.ribaoNo": userStore.userInfo.userId,
        "yunweiZongJieDTO.ribaoOrgNo": userStore.userInfo.orgNo,
        "yunweiZongJieDTO.ribaoOrgName": userStore.userInfo.orgName,
        "yunweiZongJieDTO.gangwei": type,
        "yunweiZongJieDTO.leixing": radio.value
      };
      if (
        !params["yunweiZongJieDTO.request_tongji_wangluo"] &&
        !params["yunweiZongJieDTO.special_tongji_wangluo"] &&
        !params["yunweiZongJieDTO.problem_tongji_wangluo"] &&
        !params["yunweiZongJieDTO.solution_tongji_wangluo"] &&
        !params["yunweiZongJieDTO.plan_tongji_wangluo"]
      ) {
        ElNotification({
          message: h("i", { style: "color: red" }, "请输入至少一条数据"),
          customClass: "http-message"
        });
        return;
      }
    }
    if (type === 3) {
      params = {
        "yunweiZongJieDTO.request_tongji_yingyong": appEvent.value,
        "yunweiZongJieDTO.special_tongji_yingyong": appWork.value,
        "yunweiZongJieDTO.problem_tongji_yingyong": appProblem.value,
        "yunweiZongJieDTO.solution_tongji_yingyong": appSolution.value,
        "yunweiZongJieDTO.plan_tongji_yingyong": appPlan.value,
        "yunweiZongJieDTO.ribaoNo": userStore.userInfo.userId,
        "yunweiZongJieDTO.ribaoOrgNo": userStore.userInfo.orgNo,
        "yunweiZongJieDTO.ribaoOrgName": userStore.userInfo.orgName,
        "yunweiZongJieDTO.gangwei": type,
        "yunweiZongJieDTO.leixing": radio.value
      };
      if (
        !params["yunweiZongJieDTO.request_tongji_yingyong"] &&
        !params["yunweiZongJieDTO.special_tongji_yingyong"] &&
        !params["yunweiZongJieDTO.problem_tongji_yingyong"] &&
        !params["yunweiZongJieDTO.solution_tongji_yingyong"] &&
        !params["yunweiZongJieDTO.plan_tongji_yingyong"]
      ) {
        ElNotification({
          message: h("i", { style: "color: red" }, "请输入至少一条数据"),
          customClass: "http-message"
        });
        return;
      }
    }
    if (type === 4) {
      params = {
        "yunweiZongJieDTO.request_tongji_shujuku": dbEvent.value,
        "yunweiZongJieDTO.special_tongji_shujuku": dbWork.value,
        "yunweiZongJieDTO.problem_tongji_shujuku": dbProblem.value,
        "yunweiZongJieDTO.solution_tongji_shujuku": dbSolution.value,
        "yunweiZongJieDTO.plan_tongji_shujuku": dbPlan.value,
        "yunweiZongJieDTO.ribaoNo": userStore.userInfo.userId,
        "yunweiZongJieDTO.ribaoOrgNo": userStore.userInfo.orgNo,
        "yunweiZongJieDTO.ribaoOrgName": userStore.userInfo.orgName,
        "yunweiZongJieDTO.gangwei": type,
        "yunweiZongJieDTO.leixing": radio.value
      };
      if (
        !params["yunweiZongJieDTO.request_tongji_shujuku"] &&
        !params["yunweiZongJieDTO.special_tongji_shujuku"] &&
        !params["yunweiZongJieDTO.problem_tongji_shujuku"] &&
        !params["yunweiZongJieDTO.solution_tongji_shujuku"] &&
        !params["yunweiZongJieDTO.plan_tongji_shujuku"]
      ) {
        ElNotification({
          message: h("i", { style: "color: red" }, "请输入至少一条数据"),
          customClass: "http-message"
        });
        return;
      }
    }
    console.log(params);
    if (params === undefined || params === null) {
      ElMessage.error("请输入内容");
      return;
    } else {
      try {
        const res = (await addDailyWork(params, eavparam)) as any;
        if (res == "保存成功") {
          // dialogVisible.value = false;
          proTable.value?.getTableList();
          ElNotification({
            title: "Success",
            message: "保存成功",
            type: "success",
            customClass: "http-message"
          });
        }
        if (res === "当前报告类型存在相同的数据，不可重复提交，请进行修改") {
          // dialogVisible.value = false;
          proTable.value?.getTableList();
          // ElMessage.warning("日报当天已存在相同的信息,请勿重复记录");
          ElNotification({
            title: "Error",
            message: "报告已存在相同的信息,请勿重复记录",
            type: "error",
            customClass: "http-message"
          });
        }
        if (res === "日报当天已存在相同的信息,请勿重复记录") {
          // dialogVisible.value = false;
          proTable.value?.getTableList();
          // ElMessage.warning("日报当天已存在相同的信息,请勿重复记录");
          ElNotification({
            title: "Error",
            message: "日报当天已存在相同的信息,请勿重复记录",
            type: "error",
            customClass: "http-message"
          });
        }
        if (res === "周报当天已存在相同的信息,请勿重复记录") {
          // dialogVisible.value = false;
          proTable.value?.getTableList();
          ElNotification({
            title: "Error",
            message: "周报当天已存在相同的信息,请勿重复记录",
            type: "error",
            customClass: "http-message"
          });
        }
        if (res === "月报当天已存在相同的信息,请勿重复记录") {
          // dialogVisible.value = false;
          proTable.value?.getTableList();
          ElNotification({
            title: "Error",
            message: "月报当天已存在相同的信息,请勿重复记录",
            type: "error",
            customClass: "http-message"
          });
        }
      } catch (e) {
        dialogVisible.value = false;
        ElMessage.error("网络错误");
      }
    }
  }
  if (titleText.value == "编辑报告") {
    let params;

    if (1 == 1) {
      params = {
        "yunweiZongJieDTO.request_tongji_zhuomian": dtEvent.value,
        "yunweiZongJieDTO.special_tongji_zhuomian": dtWork.value,
        "yunweiZongJieDTO.problem_tongji_zhuomian": dtProblem.value,
        "yunweiZongJieDTO.solution_tongji_zhuomian": dtSolution.value,
        "yunweiZongJieDTO.plan_tongji_zhuomian": dtPlan.value,
        "yunweiZongJieDTO.ribaoNo": userStore.userInfo.userId,
        "yunweiZongJieDTO.ribaoOrgNo": userStore.userInfo.orgNo,
        "yunweiZongJieDTO.ribaoOrgName": userStore.userInfo.orgName,
        "yunweiZongJieDTO.gangwei": type,
        "yunweiZongJieDTO.leixing": radio.value,
        "yunweiZongJieDTO.id": id.value
      };
      let isNUll = true;
      Object.keys(eavparam).forEach(key => {
        if (`${eavparam[key]}` != "" && `${eavparam[key]}` != undefined && `${eavparam[key]}` != null) {
          isNUll = false;
        }
      });
      if (isNUll) {
        ElNotification({
          message: h("i", { style: "color: red" }, "请输入至少一条数据"),
          customClass: "http-message"
        });
        return;
      }
    }

    if (type === 0) {
      params = {
        "yunweiZongJieDTO.request_tongji_zhuomian": dtEvent.value,
        "yunweiZongJieDTO.special_tongji_zhuomian": dtWork.value,
        "yunweiZongJieDTO.problem_tongji_zhuomian": dtProblem.value,
        "yunweiZongJieDTO.solution_tongji_zhuomian": dtSolution.value,
        "yunweiZongJieDTO.plan_tongji_zhuomian": dtPlan.value,
        "yunweiZongJieDTO.ribaoNo": userStore.userInfo.userId,
        "yunweiZongJieDTO.ribaoOrgNo": userStore.userInfo.orgNo,
        "yunweiZongJieDTO.ribaoOrgName": userStore.userInfo.orgName,
        "yunweiZongJieDTO.gangwei": type.value,
        "yunweiZongJieDTO.leixing": radio.value,
        "yunweiZongJieDTO.id": id.value
      };
      // 检查前五个参数是否为空
      if (
        !params["yunweiZongJieDTO.request_tongji_zhuomian"] &&
        !params["yunweiZongJieDTO.special_tongji_zhuomian"] &&
        !params["yunweiZongJieDTO.problem_tongji_zhuomian"] &&
        !params["yunweiZongJieDTO.solution_tongji_zhuomian"] &&
        !params["yunweiZongJieDTO.plan_tongji_zhuomian"]
      ) {
        ElNotification({
          message: h("i", { style: "color: red" }, "请输入至少一条数据"),
          customClass: "http-message"
        });
        return;
      }
    }
    if (type === 1) {
      params = {
        "yunweiZongJieDTO.request_tongji_jichu": bsEvent.value,
        "yunweiZongJieDTO.special_tongji_jichu": bsWork.value,
        "yunweiZongJieDTO.problem_tongji_jichu": bsProblem.value,
        "yunweiZongJieDTO.solution_tongji_jichu": bsSolution.value,
        "yunweiZongJieDTO.plan_tongji_jichu": bsPlan.value,
        "yunweiZongJieDTO.ribaoNo": userStore.userInfo.userId,
        "yunweiZongJieDTO.ribaoOrgNo": userStore.userInfo.orgNo,
        "yunweiZongJieDTO.ribaoOrgName": userStore.userInfo.orgName,
        "yunweiZongJieDTO.gangwei": type.value,
        "yunweiZongJieDTO.leixing": radio.value,
        "yunweiZongJieDTO.id": id.value
      };
      if (
        !params["yunweiZongJieDTO.request_tongji_jichu"] &&
        !params["yunweiZongJieDTO.special_tongji_jichu"] &&
        !params["yunweiZongJieDTO.problem_tongji_jichu"] &&
        !params["yunweiZongJieDTO.solution_tongji_jichu"] &&
        !params["yunweiZongJieDTO.plan_tongji_jichu"]
      ) {
        ElNotification({
          message: h("i", { style: "color: red" }, "请输入至少一条数据"),
          customClass: "http-message"
        });
        return;
      }
    }
    if (type === 2) {
      params = {
        "yunweiZongJieDTO.request_tongji_wangluo": ntEvent.value,
        "yunweiZongJieDTO.special_tongji_wangluo": ntWork.value,
        "yunweiZongJieDTO.problem_tongji_wangluo": ntProblem.value,
        "yunweiZongJieDTO.solution_tongji_wangluo": ntSolution.value,
        "yunweiZongJieDTO.plan_tongji_wangluo": ntPlan.value,
        "yunweiZongJieDTO.ribaoNo": userStore.userInfo.userId,
        "yunweiZongJieDTO.ribaoOrgNo": userStore.userInfo.orgNo,
        "yunweiZongJieDTO.ribaoOrgName": userStore.userInfo.orgName,
        "yunweiZongJieDTO.gangwei": type.value,
        "yunweiZongJieDTO.leixing": radio.value,
        "yunweiZongJieDTO.id": id.value
      };
      if (
        !params["yunweiZongJieDTO.request_tongji_wangluo"] &&
        !params["yunweiZongJieDTO.special_tongji_wangluo"] &&
        !params["yunweiZongJieDTO.problem_tongji_wangluo"] &&
        !params["yunweiZongJieDTO.solution_tongji_wangluo"] &&
        !params["yunweiZongJieDTO.plan_tongji_wangluo"]
      ) {
        ElNotification({
          message: h("i", { style: "color: red" }, "请输入至少一条数据"),
          customClass: "http-message"
        });
        return;
      }
    }
    if (type === 3) {
      params = {
        "yunweiZongJieDTO.request_tongji_yingyong": appEvent.value,
        "yunweiZongJieDTO.special_tongji_yingyong": appWork.value,
        "yunweiZongJieDTO.problem_tongji_yingyong": appProblem.value,
        "yunweiZongJieDTO.solution_tongji_yingyong": appSolution.value,
        "yunweiZongJieDTO.plan_tongji_yingyong": appPlan.value,
        "yunweiZongJieDTO.ribaoNo": userStore.userInfo.userId,
        "yunweiZongJieDTO.ribaoOrgNo": userStore.userInfo.orgNo,
        "yunweiZongJieDTO.ribaoOrgName": userStore.userInfo.orgName,
        "yunweiZongJieDTO.gangwei": type.value,
        "yunweiZongJieDTO.leixing": radio.value,
        "yunweiZongJieDTO.id": id.value
      };
      if (
        !params["yunweiZongJieDTO.request_tongji_yingyong"] &&
        !params["yunweiZongJieDTO.special_tongji_yingyong"] &&
        !params["yunweiZongJieDTO.problem_tongji_yingyong"] &&
        !params["yunweiZongJieDTO.solution_tongji_yingyong"] &&
        !params["yunweiZongJieDTO.plan_tongji_yingyong"]
      ) {
        ElNotification({
          message: h("i", { style: "color: red" }, "请输入至少一条数据"),
          customClass: "http-message"
        });
        return;
      }
    }
    if (type === 4) {
      params = {
        "yunweiZongJieDTO.request_tongji_shujuku": dbEvent.value,
        "yunweiZongJieDTO.special_tongji_shujuku": dbWork.value,
        "yunweiZongJieDTO.problem_tongji_shujuku": dbProblem.value,
        "yunweiZongJieDTO.solution_tongji_shujuku": dbSolution.value,
        "yunweiZongJieDTO.plan_tongji_shujuku": dbPlan.value,
        "yunweiZongJieDTO.ribaoNo": userStore.userInfo.userId,
        "yunweiZongJieDTO.ribaoOrgNo": userStore.userInfo.orgNo,
        "yunweiZongJieDTO.ribaoOrgName": userStore.userInfo.orgName,
        "yunweiZongJieDTO.gangwei": type.value,
        "yunweiZongJieDTO.leixing": radio.value,
        "yunweiZongJieDTO.id": id.value
      };
      if (
        !params["yunweiZongJieDTO.request_tongji_shujuku"] &&
        !params["yunweiZongJieDTO.special_tongji_shujuku"] &&
        !params["yunweiZongJieDTO.problem_tongji_shujuku"] &&
        !params["yunweiZongJieDTO.solution_tongji_shujuku"] &&
        !params["yunweiZongJieDTO.plan_tongji_shujuku"]
      ) {
        ElNotification({
          message: h("i", { style: "color: red" }, "请输入至少一条数据"),
          customClass: "http-message"
        });
        return;
      }
    }
    console.log(params);
    if (params === undefined || params === null) {
      return;
    } else {
      try {
        const res = (await editDailyWork(params, eavparam)) as any;
        if (res === "修改成功") {
          // dialogVisible.value = false;
          proTable.value?.getTableList();
          ElNotification({
            title: "Success",
            message: "修改成功",
            type: "success",
            customClass: "http-message"
          });
        }
        if (res !== "修改成功") {
          // dialogVisible.value = false;
          proTable.value?.getTableList();
          ElNotification({
            title: "Error",
            message: "当前报告类型存在相同的数据，不可重复提交，请重新修改",
            type: "error",
            customClass: "http-message"
          });
        }
        if (res === "日报当天已存在相同的信息,请勿重复记录") {
          dialogVisible.value = false;
          proTable.value?.getTableList();
          ElMessage.success("日报当天已存在相同的信息,请勿重复记录");
        }
      } catch (e) {
        dialogVisible.value = false;
        ElMessage.error("网络错误");
      }
    }
  }
};
//删除事件
const deleteItem = async row => {
  ElMessageBox.confirm("确实要删除选择的数据吗？", "删除确认", {
    confirmButtonText: "确认",
    cancelButtonText: "取消",
    type: "warning",
    center: true
  })
    .then(async () => {
      let params = "requestId=" + row.id;
      try {
        const data = (await deleteDailyWork(params)) as any;
        if (data === "删除成功") {
          ElNotification({
            title: "Success",
            message: "删除成功",
            type: "success",
            customClass: "http-message"
          });
          proTable.value?.clearSelection();
          proTable.value?.getTableList();
        }
      } catch {
        ElMessage.error("此数据存在相关联的数据，不能删除");
      }
    })
    .catch(() => {
      ElMessage({
        type: "info",
        message: "取消删除"
      });
    });
};
//批量删除
const delSelectItem = e => {
  console.log(e);
  ElMessageBox.confirm("确实要删除选择的数据吗？", "删除确认", {
    confirmButtonText: "确认",
    cancelButtonText: "取消",
    type: "warning",
    center: true
  })
    .then(async () => {
      let params = "";
      e.forEach(item => {
        params += "requestId=" + item.id + "&";
      });
      try {
        const data = (await deleteDailyWork(params)) as any;
        if (data === "删除成功") {
          ElNotification({
            title: "Success",
            message: "删除成功",
            type: "success",
            customClass: "http-message"
          });
          proTable.value?.clearSelection();
          proTable.value?.getTableList();
        }
      } catch {
        ElMessage.error("此数据存在相关联的数据，不能删除");
      }
    })
    .catch(() => {
      ElMessage({
        type: "info",
        message: "取消删除"
      });
    });
};
//查看详情
const dialogDetailVisible = ref(false);
const activeDetailName = ref("deskTop_Detail");
const formDetail = ref<any>({});
const leixing = ref("");
const detailTypeText = ref("");
const seeDetails = async row => {
  pictureOpt.value = "see";

  if (pictureOpt.value == "see") {
    type.value = row.leixing;
    if (row.leixing === 0) {
      typeText.value = "日";
    }
    if (row.leixing === 1) {
      typeText.value = "周";
    }
    if (row.leixing === 2) {
      typeText.value = "月";
    }
    pictureDataForm.leixing = row.leixing.toString();
    pictureDataForm.orgNo = row.ribaoOrgNo;
    if (row.leixing == 0) {
      pictureDataForm.ribaoDate = row.createdOn;
      console.log(pictureDataForm.ribaoDate);
    }
    if (row.leixing == 1) {
      const now = new Date();
      const sevenDaysAgo = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
      const pad = (n: number) => (n < 10 ? "0" + n : "" + n);
      const format = (d: Date) =>
        `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;

      const date = new Date(row.createdOn.replace(" ", "T"));
      pictureDataForm.zhoubaoStartDate = format(date);
      pictureDataForm.zhoubaoEndDate = row.createdOn;
      console.log(pictureDataForm.zhoubaoStartDate);
      console.log(pictureDataForm.zhoubaoEndDate);
    }
    if (row.leixing == 2) {
      const now = new Date(row.createdOn.replace(" ", "T"));
      const pad = (n: number) => (n < 10 ? "0" + n : "" + n);
      const yyyy = now.getFullYear();
      const MM = pad(now.getMonth() + 1);
      const dd = "01";
      pictureDataForm.yuebaoDate = `${yyyy}-${MM}-${dd} 00:00:00`;
      console.log(pictureDataForm.yuebaoDate);
    }
  }

  console.log(row);
  dialogDetailVisible.value = true;
  const params = "requestId=" + row.id;
  const res = (await getDailyWorkInfo(params)) as any;
  if (res) {
    formDetail.value = {
      ...res
    };
    let newRes = JSON.parse(JSON.stringify(res));
    tabsData.forEach((child: TabData) => {
      child.wangEditorContent.forEach((childWangEditorContent: WangEditorContent) => {
        Object.keys(newRes.attrVals).forEach(key => {
          if (`${key}` == childWangEditorContent.id) {
            childWangEditorContent.content = `${newRes.attrVals[key]}` == undefined ? "" : `${newRes.attrVals[key]}`;
          }
        });
      });
    });
    // 过滤掉空元素
    // formDetail.value = Object.fromEntries(Object.entries(res).filter(([_, v]) => v !== ""));
    if (formDetail.value.leixing === 0) {
      leixing.value = "日报";
      detailTypeText.value = "日";
    } else if (formDetail.value.leixing === 1) {
      leixing.value = "周报";
      detailTypeText.value = "周";
    } else if (formDetail.value.leixing === 2) {
      leixing.value = "月报";
      detailTypeText.value = "月";
    } else {
      leixing.value = "未知";
    }
    if (gangweiSelect.value.length > 0) {
      activeDetailName.value = "0";
      //             if(gangweiSelect.value[0]=="桌面"){
      //               activeDetailName.value="deskTop_Detail";
      //             }
      //             if(gangweiSelect.value[0]=="基础"){
      //               activeDetailName.value="base_Detail";
      //             }
      //             if(gangweiSelect.value[0].toString()=="网络"){
      //               activeDetailName.value="network_Detail";
      //             }
      //             if(gangweiSelect.value[0]=="应用"){
      //               activeDetailName.value="app_Detail";
      //             }
      //             if(gangweiSelect.value[0]=="数据库"){
      //               activeDetailName.value="database_Detail";
      //             }
    }
  }
  reLoadPicture();
};
</script>
<style lang="scss" scoped>
.http-message {
  z-index: 20010 !important;
}
.demo-tabs > .el-tabs__content {
  padding: 32px;
  font-size: 32px;
  font-weight: 600;
  color: #6b778c;
}
.item {
  display: flex;
  width: 90%;
  font-size: 14px;
  border: 1px solid #cbcaca;
  border-bottom: none;
}
.item_label {
  display: inline-block;
  width: 30%;
  padding-left: 10px;
  font-weight: bold;
  line-height: 34px;
  color: #000000;
  vertical-align: middle;
  background: #e5e5e5;
  border: 1px solid #e5e5e5;
}
.item-content {
  display: inline-block;
  width: 70%;
  padding: 0 5px;
  line-height: 34px;
  vertical-align: middle;
  p {
    margin: 0;
  }
}
</style>
